Metadata-Version: 2.4
Name: aiwe
Version: 0.0.3
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 a family: 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.
  An agent brings back an old version of a file, and finds what was said in another chat.
- **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. Only
  the users the admin opens it to write to it. Another user writes a proposal, which one of them
  reads and sends as their own message.
- **Your data.** The files and the chats stay on your server. Each family member 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. The app is made for a desktop browser;
phones are left for later.

## 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).

## 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. Open it to yourself:
   a new agent is open to nobody. 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.

## Running

`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:
[Deployment](https://github.com/pybass/aiwe/blob/main/docs/deployment.md#autostart) sets that up.
`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.

For a forgotten password, run `aiwe password <username>`: it asks for a new one.

The data dir holds the database and the projects. A project is a plain folder there,
`projects/<slug>/`: what the app keeps in it is in
[Project folder](https://github.com/pybass/aiwe/blob/main/docs/project-folder.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.

## Setup

What the admin sets on the server, beyond the pages of the app. The app reads `config.toml` in the data
dir when it starts. With a key it does not know in the file, it does not start.

### Agents

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`. More in
[Agents](https://github.com/pybass/aiwe/blob/main/docs/agents-work.md#kinds-and-logins).

The app makes one project by itself, System, open to the admin. Its `RULES.md` holds the rules every
agent follows in every project, such as the language to answer in: tell an agent there which rule to
add. An agent there is also allowed to work outside the project folder, on the whole server. More in
[Project folder](https://github.com/pybass/aiwe/blob/main/docs/project-folder.md#the-system-project).

Every other project has a `RULES.md` too, for its own rules.

### 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`:

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

The app then answers under that name too, and expects HTTPS there. Cloudflare Tunnel with Cloudflare
Access is such a proxy, with a second sign-in in front of the app. The setup, step by step:
[Deployment](https://github.com/pybass/aiwe/blob/main/docs/deployment.md).

### Dictation

The form of a chat 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`, 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.

## Docs

- [Deployment](https://github.com/pybass/aiwe/blob/main/docs/deployment.md): aiwe on a server, step by
  step.
- [Scenarios](https://github.com/pybass/aiwe/blob/main/docs/scenarios.md): what people do in aiwe.
- [Chats](https://github.com/pybass/aiwe/blob/main/docs/chats.md),
  [Agents](https://github.com/pybass/aiwe/blob/main/docs/agents-work.md),
  [Project folder](https://github.com/pybass/aiwe/blob/main/docs/project-folder.md) and
  [Users](https://github.com/pybass/aiwe/blob/main/docs/users.md): how the app behaves, in detail.
- [Architecture](https://github.com/pybass/aiwe/blob/main/docs/architecture.md) and
  [Simplicity](https://github.com/pybass/aiwe/blob/main/docs/simplicity.md): how the code is written.

## 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 .`.
