Metadata-Version: 2.4
Name: aiwe
Version: 0.0.1
Summary: A private web app for long-lived projects worked on with AI agents.
Author: pybass
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.15
Requires-Dist: fastapi==0.165.0
Requires-Dist: jinja2==3.1.6
Requires-Dist: markdown-it-py==4.3.0
Requires-Dist: pyjwt[crypto]==2.15.1
Requires-Dist: python-multipart==0.0.34
Requires-Dist: uvicorn==0.55.0
Requires-Python: >=3.15
Project-URL: Repository, https://github.com/pybass/aiwe
Project-URL: Issues, https://github.com/pybass/aiwe/issues
Description-Content-Type: text/markdown

# aiwe

A private web app for long-lived projects worked on with AI agents. It runs on your own server.

- **Projects, not scattered chats.** A project is a folder of files, with their history and its chats.
- **Agents that work together.** Claude Code and Codex work in the project folder and answer in a chat.
  One can ask another, such as Codex to check a plan of Claude.
- **Your subscriptions.** An agent is a Claude or Codex CLI with the login it has on the server.
- **Your data.** The files and the chats stay on your server. Each person has a login, and a project is
  open only to the users it names.

**Early development.** Until version 0.1 an update may need a new database: the users, the agents and the
chats of the app are then gone, and the project folders stay. What aiwe should become is in
[Design](https://github.com/pybass/aiwe/blob/main/docs/design.md).

## Install

On a Linux or macOS machine. You need:

- [uv](https://docs.astral.sh/uv/) and `git`;
- the CLI of Claude Code or of Codex, or both, logged in under the account that runs aiwe.

```sh
uv tool install aiwe
aiwe start          # http://127.0.0.1:7788, data in ~/aiwe
aiwe stop
```

An agent may do anything the account that runs aiwe may. Give a login only to people you trust with that
account. On a server, run aiwe under a user of its own:
[Deployment](https://github.com/pybass/aiwe/blob/main/docs/deployment.md).

To update, run `uv tool upgrade aiwe`, then stop and start the app. A new version that changes the
database first copies it to `aiwe.db.v<N>` in the data dir, where N is the old version of its schema.
Delete a copy you no longer need.

`aiwe start` runs the app in the background and writes its output to `aiwe.log` in the data dir. It does
not start again after a reboot or a crash. `aiwe stop` ends the app and the agents that still work.
`aiwe serve` runs the app in the terminal. One data dir takes one app at a time. `--port` and
`--data-dir` after a command change the defaults.

## First steps

1. Open `http://127.0.0.1:7788` and create the admin.
2. On the Admin page, add an agent: a Claude or Codex CLI, under a name of its own. Press Check there: it
   tells whether the agent works.
3. On the first page, create a project.
4. Open the project, press New chat, and write to the agent.

## Projects

Create a project on the first page: give it a name and a slug. The slug names its folder,
`~/aiwe/projects/<slug>/`. What the app keeps in the folder is in
[Project folder](https://github.com/pybass/aiwe/blob/main/docs/project-folder.md).

A new project is open only to the user who created it. While a project is open, the account menu at the top
right lists its settings. Access there opens the project to other users: to read its chats and files, or with
full access, which also lets them write to agents and change who has access. Agents there names the agent
a new chat starts on, and the model and effort each agent writes with in the project.

## Files

The files of the project are listed on the left. Open one to read it: Markdown, text, images and PDF
show in the page, any other file can be downloaded. ↻ refreshes the list.

Under an answer the chat lists the files that changed while the agent wrote it. The app keeps the history
of the files: to bring back an old version of a file, ask an agent.

## Chats

Open a project and press New chat. Pick an agent and write to it: the agent works in the project folder
and answers in the chat. While it works, the page shows what it does. Write to it again while it works, or
press Stop.

- Add files to a message to send them with it: pick them, paste them into the message, or drop them on
  the page.
- A button in the form names the model and effort the agent writes with in this chat, and changes them.
- Tell the agent to ask another one, such as "let Codex check the plan": it asks, and goes on with the
  answer it got.
- Ask an agent what was said in another chat: it can search the chats of the project.
- A chat you do not need goes to the trash: open ⋯ beside it in the list of chats. Agents no longer search
  it, and Restore takes it back.
- A text you have not sent stays in the chat when you leave the page. The files added to it do not stay.

More in [Chats](https://github.com/pybass/aiwe/blob/main/docs/chats.md) and
[Agents](https://github.com/pybass/aiwe/blob/main/docs/agents-work.md).

## Dictation

To say a message in place of typing it, press the microphone in the form and speak: the text appears as
you go. Press it again to stop, or press Send. With several speech models, the arrow beside the
microphone picks one.

The form has a microphone when the app is given a [voxo](https://github.com/pybass/voxo) that runs with a
speech model: `uv tool install voxo`, `voxo download parakeet-v3`, `voxo start`. Write its address and the
token that `voxo token` prints in `config.toml` in the data dir, then stop and start the app:

```toml
[voxo]
url = "http://127.0.0.1:7711"
token = "..."
```

For a voxo on another machine use an `https` address: the token goes with every request. The Admin page
tells why there is no dictation.

## Users

Every page needs a sign-in. For a forgotten password, run `aiwe password <username>` on the server: it
asks for a new one.

The admin adds the other users on the Admin page, and says there who may create projects. A user who may
not works only in the projects opened to them: such a login suits a shared tablet.

## Agents

The admin adds agents on the Admin page: a Claude or Codex CLI, each under a name of its own. An agent
uses the login its CLI has on the server, or one in a folder of its own, given as the setting
`home_dir=/path/to/folder`. The page of an agent sets the model and effort it writes with wherever a
project or a chat sets none. It also makes the agent the default one: a new chat starts on it in every
project that names no agent of its own.

The Admin page also lists the programs the app and its agents run on the server, and which of them are
missing.

## Other devices

The app listens only on the server itself, at `127.0.0.1`. To open it from other devices, put a proxy with
HTTPS in front of it, and name the host of the proxy in `config.toml` in the data dir:

```toml
public_host = "aiwe.example.com"
```

The app then answers under that name too, and expects HTTPS there. It reads the file when it starts. With a
key it does not know in the file, it does not start.

Cloudflare Tunnel with Cloudflare Access is such a proxy, with a second sign-in in front of the app. It is
optional. The setup, step by step: [Deployment](https://github.com/pybass/aiwe/blob/main/docs/deployment.md).

## Development

You need `uv` and `just`.

```sh
just sync    # install dependencies and Git hooks
just dev     # local app on port 3000, data in ./data; another port: just dev 3005
just check   # all checks: hooks, lint, types, tests, audit, build
```

To install the code of the checkout in place of a release, run `uv tool install --reinstall .`.
