astracode-agent 0.1.0
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/LICENSE.md +82 -0
- package/README.md +133 -0
- package/dist/astracode-agent.cjs +29233 -0
- package/package.json +37 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# AstraCode Extension — Licence
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Vanarx Tech Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
These are ordinary commercial terms and they have **not been reviewed by a
|
|
6
|
+
lawyer**. They say what this business intends. Whether they say it in a way
|
|
7
|
+
that holds up belongs to somebody qualified.
|
|
8
|
+
|
|
9
|
+
## 1. What you may do
|
|
10
|
+
|
|
11
|
+
This software is licensed, not sold. Subject to these terms, you are granted a
|
|
12
|
+
personal, non-exclusive, non-transferable, revocable licence to install and use
|
|
13
|
+
the AstraCode extension on machines you control, in connection with an
|
|
14
|
+
AstraCode account.
|
|
15
|
+
|
|
16
|
+
There is a free tier and there are paid plans. Which features you may use
|
|
17
|
+
depends on your plan, and that is enforced by the service rather than by this
|
|
18
|
+
document.
|
|
19
|
+
|
|
20
|
+
## 2. What you may not do
|
|
21
|
+
|
|
22
|
+
- Redistribute, sell, rent, lease or sublicense the extension, or any part of it.
|
|
23
|
+
- Reverse engineer, decompile or disassemble it, except where that restriction
|
|
24
|
+
is unenforceable under the law that applies to you.
|
|
25
|
+
- Remove or alter any copyright, trademark or attribution notice.
|
|
26
|
+
- Use it to build, train or operate a service that competes with AstraCode.
|
|
27
|
+
- Circumvent, or attempt to circumvent, the usage accounting or plan limits
|
|
28
|
+
applied by the AstraCode service.
|
|
29
|
+
|
|
30
|
+
## 3. The service is separate
|
|
31
|
+
|
|
32
|
+
The extension is a client. Model requests are made through the AstraCode
|
|
33
|
+
gateway, and your use of that service is governed by the Terms of Service at
|
|
34
|
+
https://astracode.io/terms/ and the Privacy Policy at
|
|
35
|
+
https://astracode.io/privacy/. Where those documents and this one disagree
|
|
36
|
+
about the service, those govern.
|
|
37
|
+
|
|
38
|
+
## 4. Components that are not ours
|
|
39
|
+
|
|
40
|
+
This package includes third-party software under its own licences, which are
|
|
41
|
+
not superseded by this document:
|
|
42
|
+
|
|
43
|
+
- `vendor/rtk` — Apache License 2.0. Full text at `vendor/rtk/LICENSE`.
|
|
44
|
+
- Bundled npm libraries, including `@anthropic-ai/sdk`,
|
|
45
|
+
`@anthropic-ai/claude-agent-sdk`, `openai` and `diff`, under their respective
|
|
46
|
+
licences.
|
|
47
|
+
|
|
48
|
+
Nothing here limits any right you have under those licences.
|
|
49
|
+
|
|
50
|
+
## 5. No warranty
|
|
51
|
+
|
|
52
|
+
The extension is provided "as is", without warranty of any kind, express or
|
|
53
|
+
implied, including merchantability, fitness for a particular purpose and
|
|
54
|
+
non-infringement.
|
|
55
|
+
|
|
56
|
+
It writes code and runs commands on your machine at your direction. **Review
|
|
57
|
+
what it produces before you ship it.** You remain responsible for your code,
|
|
58
|
+
your tests and your deployments.
|
|
59
|
+
|
|
60
|
+
## 6. Limitation of liability
|
|
61
|
+
|
|
62
|
+
To the extent permitted by law, Vanarx Tech Inc. is not liable for any
|
|
63
|
+
indirect, incidental, special or consequential damages, or for lost profits,
|
|
64
|
+
lost data or business interruption, arising from the use of or inability to use
|
|
65
|
+
this software. Total liability for any claim is limited to the amount you paid
|
|
66
|
+
for the extension in the twelve months before the claim.
|
|
67
|
+
|
|
68
|
+
## 7. Term
|
|
69
|
+
|
|
70
|
+
This licence applies for as long as you comply with it. It ends automatically
|
|
71
|
+
if you breach section 2, and on termination you must stop using the extension.
|
|
72
|
+
|
|
73
|
+
## 8. Governing law
|
|
74
|
+
|
|
75
|
+
The State of Delaware, United States.
|
|
76
|
+
|
|
77
|
+
Customers in Nepal contract with Vanarx Tech Pvt Ltd, and the governing law is
|
|
78
|
+
Nepal. See https://astracode.io/np/terms/.
|
|
79
|
+
|
|
80
|
+
## Contact
|
|
81
|
+
|
|
82
|
+
yug@vanarxtech.com
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# AstraCode agent CLI
|
|
2
|
+
|
|
3
|
+
The AstraCode agent without the editor. It runs one task in the current
|
|
4
|
+
directory, then exits. Use it from a shell, a CI job or a script.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
curl -fsSL https://astracode.io/install | sh
|
|
8
|
+
astracode-agent login
|
|
9
|
+
astracode-agent -p "why does the login test fail?"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The installer puts a standalone binary in `~/.local/bin`, with Node built in.
|
|
13
|
+
It works on macOS and Linux, on arm64 and x64. It checks the download's
|
|
14
|
+
checksum, and on a Mac also checks that AstraCode signed it. To update, run
|
|
15
|
+
`astracode-agent update`, which runs the same installer for the latest version.
|
|
16
|
+
|
|
17
|
+
With Node 20 or later you can also install it from npm:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g astracode-agent
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
It runs the same agent as the AstraCode editor, including AstraOne's model
|
|
24
|
+
routing, the same tools and the same approval rules. Usage is billed to your
|
|
25
|
+
AstraCode account, the same way as usage in the editor.
|
|
26
|
+
|
|
27
|
+
The command is `astracode-agent` because `astracode` is the command that opens
|
|
28
|
+
the editor.
|
|
29
|
+
|
|
30
|
+
## Signing in
|
|
31
|
+
|
|
32
|
+
**On your own machine**, run `astracode-agent login` once. It signs you in
|
|
33
|
+
through your browser, like the editor does, and keeps the session: in the
|
|
34
|
+
Keychain on macOS, and in `~/.config/astracode` elsewhere.
|
|
35
|
+
|
|
36
|
+
Each run renews the session, so it stays signed in as long as you use it at
|
|
37
|
+
least every day and a half. `astracode-agent logout` forgets it.
|
|
38
|
+
|
|
39
|
+
**In CI, over SSH, or anywhere without a browser**, create an API key on your
|
|
40
|
+
AstraCode dashboard under API keys and set it:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
export ASTRACODE_API_KEY=ac_live_...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
A key takes precedence over a saved session. A key can have its own spending
|
|
47
|
+
limit, and you can revoke it without signing anyone out.
|
|
48
|
+
|
|
49
|
+
## Running a task
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
astracode-agent -p "<prompt>" [options]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| option | |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `-p, --print <prompt>` | The task. `-` reads it from stdin. |
|
|
58
|
+
| `--mode agent\|plan` | `agent` (the default) makes the change. `plan` only writes a plan. |
|
|
59
|
+
| `--output-format text\|json\|stream-json` | See below. |
|
|
60
|
+
| `--permissions read-only\|auto\|full` | What the agent may do. See below. |
|
|
61
|
+
| `--max-steps <n>` | Step limit for the run. The default is 150. |
|
|
62
|
+
| `--cwd <dir>` | The workspace. The default is the current directory. |
|
|
63
|
+
| `-v, --verbose` | Prints the agent's log on stderr. |
|
|
64
|
+
|
|
65
|
+
### Permissions
|
|
66
|
+
|
|
67
|
+
No one is there to approve anything, so this setting decides up front.
|
|
68
|
+
|
|
69
|
+
- **`read-only`** (the default): the agent reads, searches and answers. It is
|
|
70
|
+
refused every edit and every command, and it is told they were refused.
|
|
71
|
+
- **`auto`**: the agent edits files and runs commands. It is still refused
|
|
72
|
+
what the editor asks about even in autonomous mode: a command the risk check
|
|
73
|
+
flags (such as `git push` or `rm -rf` outside the project), a request to
|
|
74
|
+
another machine, and saving a memory.
|
|
75
|
+
- **`full`**: those are allowed too.
|
|
76
|
+
|
|
77
|
+
Every refused action is listed in the result, so a CI log says why nothing
|
|
78
|
+
changed.
|
|
79
|
+
|
|
80
|
+
### Output
|
|
81
|
+
|
|
82
|
+
- **`text`**: stdout is the agent's final answer, and nothing else.
|
|
83
|
+
- **`json`**: stdout is one object, with `ok`, `end`, `summary`,
|
|
84
|
+
`filesChanged`, `denied`, `steps`, `costUsd` and `durationMs`.
|
|
85
|
+
- **`stream-json`**: one JSON object per line, one for each agent event
|
|
86
|
+
(tool calls, tool results, text, todos), then the same result object.
|
|
87
|
+
|
|
88
|
+
### Exit status
|
|
89
|
+
|
|
90
|
+
| code | meaning |
|
|
91
|
+
|---|---|
|
|
92
|
+
| 0 | The agent finished. |
|
|
93
|
+
| 1 | It did not finish (step limit, a loop, an error), or the gateway refused. |
|
|
94
|
+
| 2 | Usage error, or not signed in. |
|
|
95
|
+
| 130 | Interrupted. |
|
|
96
|
+
|
|
97
|
+
A run that stopped short fails the job. It does not report success with an
|
|
98
|
+
apology in the summary.
|
|
99
|
+
|
|
100
|
+
## In GitHub Actions
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
- uses: actions/setup-node@v4
|
|
104
|
+
with:
|
|
105
|
+
node-version: 20
|
|
106
|
+
- run: npm install -g astracode-agent
|
|
107
|
+
- run: astracode-agent -p "Fix the failing test in tests/test_billing.py" --permissions auto --output-format json
|
|
108
|
+
env:
|
|
109
|
+
ASTRACODE_API_KEY: ${{ secrets.ASTRACODE_API_KEY }}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Let the agent make the edits, and let the workflow's own steps commit, push and
|
|
113
|
+
comment. The agent refuses `git push` under `auto` for that reason.
|
|
114
|
+
|
|
115
|
+
## What is different from the editor
|
|
116
|
+
|
|
117
|
+
These are not available without an editor:
|
|
118
|
+
|
|
119
|
+
- diagnostics and language-server lookups
|
|
120
|
+
- MCP servers
|
|
121
|
+
- the code index
|
|
122
|
+
- memories and checkpoints
|
|
123
|
+
|
|
124
|
+
Content search uses `rg` from your `PATH`. Install ripgrep for it; GitHub's
|
|
125
|
+
runners already have it.
|
|
126
|
+
|
|
127
|
+
## Environment
|
|
128
|
+
|
|
129
|
+
| variable | |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `ASTRACODE_API_KEY` | An `ac_live_` key. Takes precedence over a saved session. |
|
|
132
|
+
| `ASTRACODE_GATEWAY_URL` | The gateway to use. The default is `https://api.astracode.io`. |
|
|
133
|
+
| `ASTRACODE_CONFIG_DIR` | Keep the session in this folder instead of the Keychain or `~/.config/astracode`. |
|