amness 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/providers.md CHANGED
@@ -64,11 +64,22 @@ The model list in `/model` (with prices per million tokens as shown in the picke
64
64
 
65
65
  **Limits and common problems.**
66
66
 
67
- - Amness saves a key you type in `~/.amness/config.json` with file mode 600 (only you can read it).
67
+ - Amness saves a key you type in your system's secure store: the macOS Keychain, the Linux keyring (`secret-tool`) or Windows DPAPI. In Docker or Kubernetes it saves nothing: pass the key as an environment variable or a `*_FILE` secret. On a Linux server with no keyring it uses `~/.amness/config.json` with file mode 600, which is not encrypted. See [Safety](safety.md).
68
68
  - The environment variable wins over the saved file. `ANTHROPIC_API_KEY` is used when the provider is `anthropic`. `OPENAI_API_KEY` is used for **every other provider**, including `openrouter`. `OPENROUTER_API_KEY` is not read as a key.
69
69
  - If the chat says "check your key with /provider", the provider answered with an authentication error (401 or 403).
70
70
  - The test call checks that the model replies. It does not check that the model can call tools.
71
71
 
72
+ ## Connect several providers
73
+
74
+ You can keep a key for every provider at the same time. Each key is saved on its own (in the Keychain, the Linux keyring or DPAPI), so switching provider never overwrites another key.
75
+
76
+ 1. In the chat, type `/connect`. You see every provider with `●` (connected) or `○` (not connected), and where the key comes from: a saved key, or an environment variable.
77
+ 2. Choose a provider. If it has no key, Amness asks for one (hidden). If it has one, you can use it now, replace the key, or remove the saved key.
78
+ 3. The menu stays open, so you can add the next provider. Press `Esc` when you are done.
79
+ 4. Switch between them with `/provider`. Amness uses the saved key of the provider you pick, and asks only if there is none.
80
+
81
+ An environment variable wins over a saved key for its own provider: `ANTHROPIC_API_KEY` for Claude, `OPENROUTER_API_KEY` (or `OPENAI_API_KEY`) for OpenRouter, and `OPENAI_API_KEY` for the others. Environment keys are never saved. **Limit:** a key from an older version moves to the provider that was active when you first start the new version, so check `/connect` once.
82
+
72
83
  ## Switch provider, model or effort
73
84
 
74
85
  **How to switch in the chat.**
@@ -152,7 +163,8 @@ In `auto` mode Amness fixes these cases for you:
152
163
 
153
164
  | Variable | What it does |
154
165
  |---|---|
155
- | `OPENAI_API_KEY` | The key for every provider except `anthropic`. |
166
+ | `OPENAI_API_KEY` | The key for every provider except `anthropic` (and for OpenRouter when `OPENROUTER_API_KEY` is not set). |
167
+ | `OPENROUTER_API_KEY` | The key for `openrouter`. |
156
168
  | `ANTHROPIC_API_KEY` | The key for `anthropic`. |
157
169
  | `OPENAI_BASE_URL` | The base URL for non-Claude providers. |
158
170
  | `AMNESS_MODEL` | The model id. It wins over the saved config. |
package/docs/safety.md CHANGED
@@ -35,7 +35,20 @@ Notes about the provider:
35
35
 
36
36
  ## Know where your keys are stored
37
37
 
38
- - Keys come from the environment variables `OPENAI_API_KEY` and `ANTHROPIC_API_KEY`, or from `~/.amness/config.json`. Amness writes that file with mode 600. Only your user can read it.
38
+ - Keys come from the environment variables `OPENAI_API_KEY` and `ANTHROPIC_API_KEY`, or from the key store. A key from an environment variable is used for that run and is never saved.
39
+ - The key store depends on your system. The prompt tells you which one is in use.
40
+
41
+ | System | Where the key is saved | Protection |
42
+ |---|---|---|
43
+ | macOS | the login Keychain (service `amness`, one entry per provider, for example `apiKey-anthropic`) | encrypted by macOS |
44
+ | Linux with a desktop keyring | the secret service, through `secret-tool` | encrypted by the keyring |
45
+ | Windows | `~/.amness/secrets/apiKey-<provider>.dpapi` | encrypted with DPAPI: only your Windows user on this machine can decrypt it |
46
+ | Docker or Kubernetes | nowhere: kept in memory for that run | nothing is written to the image or a volume. Pass the key as an environment variable or a secret file (`ANTHROPIC_API_KEY_FILE=/run/secrets/anthropic`). |
47
+ | Linux server with no keyring | `~/.amness/config.json` with mode 600 | **not encrypted**, only your user can read it. Prefer an environment variable or your platform's secret manager. |
48
+
49
+ - Amness passes the key to the system tool on standard input, never on the command line, where other users could see it in the process list.
50
+ - A key that an older version saved in `config.json` is moved to the key store the next time you start Amness, and removed from the file once the move is checked.
51
+ - To remove a saved key, open the settings and clear "API key", or on macOS run `security delete-generic-password -s amness -a apiKey-anthropic` (use `apiKey-openai` and so on for the others).
39
52
  - The environment variable wins over the saved key.
40
53
  - Amness does not write keys into a project folder.
41
54
  - Commands the agent runs do not get your Amness keys. The variables `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `TAVILY_API_KEY`, `OPENROUTER_API_KEY` and `AMNESS_OTLP` are removed from their environment (`childEnv` in `src/secrets.ts`).
package/docs/usage.md CHANGED
@@ -92,7 +92,9 @@ amness --inline
92
92
  - Set the environment variable `AMNESS_UI=inline`.
93
93
  - Type `/ui inline` in the chat. `/ui full` goes back.
94
94
 
95
- **What you see.** Each tool call is one line, for example `● Read(src/a.ts)`, with a short result. `Ctrl+O` shows everything. Each edit shows a diff with line numbers. A live todo list, a status line (elapsed time and tokens) and a footer (permission mode, git branch, model, context gauge, estimated cost) stay visible. Tool bullets have a colour for each kind and turn red when the tool fails. With `NO_COLOR=1`, or when the output is piped, Amness uses plain text.
95
+ **What you see.** Each tool call is one line, for example `● Read(src/a.ts)`, with a short result. `Ctrl+O` shows everything. Each edit shows a diff with line numbers.
96
+
97
+ In the full-screen view, the **most recent** tool call stays open. A shell command shows `$ the command` and its output, up to 20 lines. When the next tool call starts, the earlier one folds to one line again. Click a line to open or close it yourself. If the output is longer than 20 lines, the card says how many are hidden. Type `/output` to read all of it in a pager (`/output 2` for the call before). A lone file read does not open itself. A live todo list, a status line (elapsed time and tokens) and a footer (permission mode, git branch, model, context gauge, estimated cost) stay visible. Tool bullets have a colour for each kind and turn red when the tool fails. With `NO_COLOR=1`, or when the output is piped, Amness uses plain text.
96
98
 
97
99
  ## Type in the input box
98
100
 
@@ -204,14 +206,36 @@ The file is attached to your message. In the transcript you see a note such as "
204
206
 
205
207
  ## Slash commands
206
208
 
207
- Type `/` in the input box to see the popup. `/help` lists the commands in the chat.
209
+ Type `/` in the input box to see the popup. It lists **every** command, grouped under titles: Conversation, Model & keys, Safety, Quality, Project, Extend and Interface. Your own and plugin commands go under Custom.
210
+
211
+ - Move with `↑` and `↓`. `PgUp` and `PgDn` jump eight at a time. The top of the box shows where you are, for example `12/60 ↓`.
212
+ - Keep typing to filter. The titles disappear and the best match comes first.
213
+ - `Tab` or `Enter` picks the command. `Esc` closes the popup.
214
+
215
+ **Completion after the command.** Type a command and a space, and the popup lists the values it accepts, each with a short explanation:
216
+
217
+ | You type | The popup shows |
218
+ |---|---|
219
+ | `/mode ` | `default`, `acceptEdits`, `plan`, `yolo` |
220
+ | `/model ` | the known models with their hints, then every other model your provider reports (OpenAI, Claude, OpenRouter, Ollama and other OpenAI-compatible servers). Amness asks the provider once and remembers the answer for ten minutes. If the provider cannot be reached, you still see the known models. |
221
+ | `/models ` | the roles (`explore`, `compact`, `review`, `cheap`, `fallback`), then the models |
222
+ | `/effort `, `/api `, `/theme `, `/shell `, `/strategy `, `/prompt `, `/sandbox `, `/diffmode `, `/ui ` | their choices |
223
+ | `/keepwarm `, `/lsp `, `/approver `, `/reviewer `, `/router `, `/mouse ` | `on`, `off` |
224
+ | `/branch ` | your turns, numbered, with the first words of each |
225
+ | `/memory `, `/permissions `, `/copy `, `/pr `, `/report `, `/mcp `, `/budget `, `/check `, `/verify ` | their sub-commands or common values |
226
+
227
+ `Enter` picks the highlighted value and runs the command. For commands that take free text or a number (`/model`, `/budget`, `/check`, `/verify`), `Enter` runs exactly what you typed unless you moved into the list with the arrow keys, so a model id that is not in the list still works. `Tab` always completes. Commands that need more words (`/memory add`, `/permissions allow`) add a space and wait.
228
+
229
+ `/help` lists the commands in the chat.
208
230
 
209
231
  ### Models and providers
210
232
 
211
233
  | Command | What it does |
212
234
  |---|---|
213
235
  | `/model [id]` | Switches the model. Without an id, it opens a picker. |
214
- | `/provider` | Switches the provider (OpenAI, Claude, OpenRouter, Ollama, custom). The choice is saved. |
236
+ | `/output [n]` (alias `/last`) | Shows the full output of the last tool call in a pager. `/output 2` shows the one before. |
237
+ | `/provider` | Switches the provider (OpenAI, Claude, OpenRouter, Ollama, custom). The list shows `●` for providers that are connected and `○` for those that are not. Each provider uses its own saved key. |
238
+ | `/connect` (alias `/keys`) | Opens the key manager. See which providers are connected, add a key for any of them, replace or remove one, or switch to it. Add as many as you want. |
215
239
  | `/effort [level]` | Sets the reasoning effort. Levels depend on the model. `default` lets the model decide. |
216
240
  | `/api [auto\|responses\|chat]` | Chooses the OpenAI wire API. It does not apply to Claude. |
217
241
  | `/models [role model]` | Uses another model for `explore`, `compact`, `review` or `cheap`. `/models fallback <model>` sets a model for when the main one is overloaded or not reachable. Use `off` to clear a role. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amness",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "A terminal coding agent for any model: streaming chat TUI, permission modes, plan mode, undo, memory, MCP, with a small reliability harness underneath. OpenAI (Responses API), Claude, and local models.",
6
6
  "license": "MIT",
@@ -52,19 +52,13 @@
52
52
  "test:pty": "python3 test/pty/tui.py",
53
53
  "prepack": "npm run build"
54
54
  },
55
+ "optionalDependencies": {
56
+ "@anthropic-ai/sdk": "^1.3.0"
57
+ },
55
58
  "devDependencies": {
56
- "@anthropic-ai/sdk": "^1.3.0",
57
59
  "@types/node": "^22.0.0",
58
60
  "typescript": "^5.8.0"
59
61
  },
60
- "peerDependencies": {
61
- "@anthropic-ai/sdk": "^1.3.0"
62
- },
63
- "peerDependenciesMeta": {
64
- "@anthropic-ai/sdk": {
65
- "optional": true
66
- }
67
- },
68
62
  "files": [
69
63
  "dist",
70
64
  "docs",