@anvi-cli/anvi 1.0.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 +189 -0
- package/README.md +195 -0
- package/bin/anvi +4 -0
- package/package.json +38 -0
- package/scripts/postinstall.js +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work.
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean any work of authorship, including
|
|
48
|
+
the original version of the Work and any modifications or additions
|
|
49
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
50
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
51
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
52
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
53
|
+
means any form of electronic, verbal, or written communication sent
|
|
54
|
+
to the Licensor or its representatives, including but not limited to
|
|
55
|
+
communication on electronic mailing lists, source code control systems,
|
|
56
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
57
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
58
|
+
excluding communication that is conspicuously marked or otherwise
|
|
59
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
60
|
+
|
|
61
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
62
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
63
|
+
subsequently incorporated within the Work.
|
|
64
|
+
|
|
65
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
66
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
67
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
68
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
69
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
70
|
+
Work and such Derivative Works in Source or Object form.
|
|
71
|
+
|
|
72
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
73
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
74
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
75
|
+
(except as stated in this section) patent license to make, have made,
|
|
76
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
77
|
+
where such license applies only to those patent claims licensable
|
|
78
|
+
by such Contributor that are necessarily infringed by their
|
|
79
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
80
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
81
|
+
institute patent litigation against any entity (including a
|
|
82
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
83
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
84
|
+
or contributory patent infringement, then any patent licenses
|
|
85
|
+
granted to You under this License for that Work shall terminate
|
|
86
|
+
as of the date such litigation is filed.
|
|
87
|
+
|
|
88
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
89
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
90
|
+
modifications, and in Source or Object form, provided that You
|
|
91
|
+
meet the following conditions:
|
|
92
|
+
|
|
93
|
+
(a) You must give any other recipients of the Work or
|
|
94
|
+
Derivative Works a copy of this License; and
|
|
95
|
+
|
|
96
|
+
(b) You must cause any modified files to carry prominent notices
|
|
97
|
+
stating that You changed the files; and
|
|
98
|
+
|
|
99
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
100
|
+
that You distribute, all copyright, patent, trademark, and
|
|
101
|
+
attribution notices from the Source form of the Work,
|
|
102
|
+
excluding those notices that do not pertain to any part of
|
|
103
|
+
the Derivative Works; and
|
|
104
|
+
|
|
105
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
106
|
+
distribution, then any Derivative Works that You distribute must
|
|
107
|
+
include a readable copy of the attribution notices contained
|
|
108
|
+
within such NOTICE file, excluding any notices that do not
|
|
109
|
+
pertain to any part of the Derivative Works, in at least one
|
|
110
|
+
of the following places: within a NOTICE text file distributed
|
|
111
|
+
as part of the Derivative Works; within the Source form or
|
|
112
|
+
documentation, if provided along with the Derivative Works; or,
|
|
113
|
+
within a display generated by the Derivative Works, if and
|
|
114
|
+
wherever such third-party notices normally appear. The contents
|
|
115
|
+
of the NOTICE file are for informational purposes only and
|
|
116
|
+
do not modify the License. You may add Your own attribution
|
|
117
|
+
notices within Derivative Works that You distribute, alongside
|
|
118
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
119
|
+
that such additional attribution notices cannot be construed
|
|
120
|
+
as modifying the License.
|
|
121
|
+
|
|
122
|
+
You may add Your own copyright statement to Your modifications and
|
|
123
|
+
may provide additional or different license terms and conditions
|
|
124
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
125
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
126
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
127
|
+
the conditions stated in this License.
|
|
128
|
+
|
|
129
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
130
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
131
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
132
|
+
this License, without any additional terms or conditions.
|
|
133
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
134
|
+
the terms of any separate license agreement you may have executed
|
|
135
|
+
with Licensor regarding such Contributions.
|
|
136
|
+
|
|
137
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
138
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
139
|
+
except as required for reasonable and customary use in describing the
|
|
140
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
141
|
+
|
|
142
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
143
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
144
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
145
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
146
|
+
implied, including, without limitation, any warranties or conditions
|
|
147
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
148
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
149
|
+
appropriateness of using or redistributing the Work and assume any
|
|
150
|
+
risks associated with Your exercise of permissions under this License.
|
|
151
|
+
|
|
152
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
153
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
154
|
+
unless required by applicable law (such as deliberate and grossly
|
|
155
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
156
|
+
liable to You for damages, including any direct, indirect, special,
|
|
157
|
+
incidental, or consequential damages of any character arising as a
|
|
158
|
+
result of this License or out of the use or inability to use the
|
|
159
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
160
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
161
|
+
other commercial damages or losses), even if such Contributor
|
|
162
|
+
has been advised of the possibility of such damages.
|
|
163
|
+
|
|
164
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
165
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
166
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
167
|
+
or other liability obligations and/or rights consistent with this
|
|
168
|
+
License. However, in accepting such obligations, You may act only
|
|
169
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
170
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
171
|
+
defend, and hold each Contributor harmless for any liability
|
|
172
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
173
|
+
of your accepting any such warranty or additional liability.
|
|
174
|
+
|
|
175
|
+
END OF TERMS AND CONDITIONS
|
|
176
|
+
|
|
177
|
+
Copyright 2026 eagleisbatman
|
|
178
|
+
|
|
179
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
180
|
+
you may not use this file except in compliance with the License.
|
|
181
|
+
You may obtain a copy of the License at
|
|
182
|
+
|
|
183
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
184
|
+
|
|
185
|
+
Unless required by applicable law or agreed to in writing, software
|
|
186
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
187
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
188
|
+
See the License for the specific language governing permissions and
|
|
189
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# >anvi.
|
|
2
|
+
|
|
3
|
+
Terminal-native AI coding agent. Built in Rust. Powered by Gemini.
|
|
4
|
+
|
|
5
|
+
Anvi is a terminal AI coding agent in the same family as Claude Code and Cursor's agent workflows, but designed as a native Rust CLI instead of a web shell wrapped in a terminal. It gives you multi-turn tool use, code editing, shell execution, sub-agent orchestration, persistent memory, and git-aware workflows with fast startup, Gemini-native defaults, and an extension model built around installable skills, MCP servers, and plugins.
|
|
6
|
+
|
|
7
|
+
Anvi is built for people who want an agent that feels like part of the terminal: fast to launch, easy to script, comfortable in large repos, and extensible without rebuilding the core product.
|
|
8
|
+
|
|
9
|
+
- Startup target: sub-150ms cold start
|
|
10
|
+
- Model-first design: Gemini 3.x as the default provider
|
|
11
|
+
- Extension surface: skills, MCP servers, plugins, templates, memory
|
|
12
|
+
- Workspace model: local-first, project-aware, and git-aware
|
|
13
|
+
|
|
14
|
+
See [Getting Started](docs/GETTING_STARTED.md) for a guided walkthrough, or [Roadmap](docs/ROADMAP.md) for the longer product vision.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# npm (recommended)
|
|
20
|
+
npm install -g @anvi-cli/anvi
|
|
21
|
+
|
|
22
|
+
# Shell installer
|
|
23
|
+
curl -fsSL https://raw.githubusercontent.com/eagleisbatman/anvi/main/install.sh | sh
|
|
24
|
+
|
|
25
|
+
# Build from source
|
|
26
|
+
cargo install --git https://github.com/eagleisbatman/anvi.git --package anvi-tui --bin anvi --force
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Set API key
|
|
33
|
+
export GEMINI_API_KEY="your-key-here"
|
|
34
|
+
|
|
35
|
+
# Run
|
|
36
|
+
anvi
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you prefer another provider, Anvi also supports `OPENAI_API_KEY` and `ANTHROPIC_API_KEY`.
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- Multi-turn agent loop with 23+ built-in tools for files, shell, git, web, memory, and tasks
|
|
44
|
+
- `/commit`, `/pr`, `/test-fix` for AI-assisted git workflows and fix-until-green loops
|
|
45
|
+
- `/plan -x` for generating a plan and executing it step by step
|
|
46
|
+
- `/review`, `/security`, `/architecture`, and 14 more built-in specialist agents
|
|
47
|
+
- `/skills search|install|create` for browsing community skills or authoring your own
|
|
48
|
+
- `/mcp browse|install|create` for adding Model Context Protocol servers
|
|
49
|
+
- `/suggest` for project stack detection with skills and MCP recommendations
|
|
50
|
+
- `/template` for reusable prompt templates with variable expansion
|
|
51
|
+
- `/memory` for persistent memory, `#keyword` recall, and team-sharing flows
|
|
52
|
+
- `/marketplace search|install|info` for unified browsing and installing skills, MCP servers, and plugins
|
|
53
|
+
- Plugin system for custom tools in any language via `~/.anvi/plugins`
|
|
54
|
+
- RTK integration for 60-90% token reduction on supported shell output
|
|
55
|
+
- CLI-Anything integration for controlling professional desktop software from the terminal
|
|
56
|
+
- `@file` mentions for prompt-time file injection and `#keyword` memory lookup
|
|
57
|
+
- Progress indicators, cost tracking, context budget visibility, and session summaries
|
|
58
|
+
|
|
59
|
+
## Configuration
|
|
60
|
+
|
|
61
|
+
Anvi stores global config in `~/.anvi/config.toml` and can layer project-local helpers under `.anvi/`.
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
# ~/.anvi/config.toml
|
|
65
|
+
[model]
|
|
66
|
+
provider = "gemini" # gemini | openai | anthropic
|
|
67
|
+
model_id = "gemini-3-flash-preview"
|
|
68
|
+
|
|
69
|
+
[optimization]
|
|
70
|
+
rtk_enabled = false # Install RTK and flip to true for token savings
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Common provider environment variables:
|
|
74
|
+
|
|
75
|
+
- Gemini: `GEMINI_API_KEY`
|
|
76
|
+
- OpenAI: `OPENAI_API_KEY`
|
|
77
|
+
- Anthropic: `ANTHROPIC_API_KEY`
|
|
78
|
+
|
|
79
|
+
Useful companion settings:
|
|
80
|
+
|
|
81
|
+
- `[permissions] mode = "default"` for approval behavior
|
|
82
|
+
- `theme = "dark"` for terminal theme preference
|
|
83
|
+
- `[[model.fallback]]` for provider/model fallback chains
|
|
84
|
+
|
|
85
|
+
## Commands Quick Reference
|
|
86
|
+
|
|
87
|
+
Slash commands are the main control surface inside the REPL. Specialist agents are also exposed as commands, so `/review`, `/security`, `/scaffold`, `/debug`, and friends behave like first-class built-ins.
|
|
88
|
+
|
|
89
|
+
| Command | Description |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `/new` | Start a fresh session in the current workspace |
|
|
92
|
+
| `/sessions` | Browse and resume recent sessions interactively |
|
|
93
|
+
| `/resume <id>` | Resume a specific session by thread ID |
|
|
94
|
+
| `/compact` | Summarize older context to free tokens |
|
|
95
|
+
| `/rewind` | Remove the last user/assistant exchange |
|
|
96
|
+
| `/model [name]` | Show or switch the active model |
|
|
97
|
+
| `/models` | Browse built-in model options |
|
|
98
|
+
| `/cost` | Estimate current session cost from token usage |
|
|
99
|
+
| `/read <path>` | Read a file into the terminal |
|
|
100
|
+
| `/write <path> [content]` | Write content or open a file in `$EDITOR` |
|
|
101
|
+
| `/edit <path>` | Open a file in your configured editor |
|
|
102
|
+
| `/bash <cmd>` | Run a shell command through the agent runtime |
|
|
103
|
+
| `/glob <pattern>` | Find files by glob pattern |
|
|
104
|
+
| `/grep <pattern>` | Search repository content with regex |
|
|
105
|
+
| `/plan [-x] <task>` | Generate a plan, optionally auto-execute it |
|
|
106
|
+
| `/diff [--staged]` | Render the current git diff |
|
|
107
|
+
| `/memory ...` | List, search, export, import, share, or prune memory |
|
|
108
|
+
| `/skills ...` | List, search, install, remove, or create skills |
|
|
109
|
+
| `/marketplace ...` | Search, install, and inspect skills, MCP servers, and plugins |
|
|
110
|
+
| `/template ...` | Run a reusable prompt template |
|
|
111
|
+
| `/commit` | Generate a conventional commit message and commit |
|
|
112
|
+
| `/pr [base]` | Draft and create a GitHub pull request |
|
|
113
|
+
| `/test-fix [n|--cmd ...]` | Run tests, fix failures, and retry |
|
|
114
|
+
| `/undo` | Revert uncommitted changes after confirmation |
|
|
115
|
+
| `/status` | Show session, environment, memory, and runtime status |
|
|
116
|
+
| `/context` | Inspect context budget and compaction pressure |
|
|
117
|
+
| `/tokens` | Show input, output, and total token usage |
|
|
118
|
+
| `/init` | Create project-local `.anvi` helper files |
|
|
119
|
+
| `/suggest` | Detect the project stack and recommend add-ons |
|
|
120
|
+
| `/plugins` | List discovered external plugin tools |
|
|
121
|
+
| `/theme [name]` | Show or switch the terminal theme |
|
|
122
|
+
| `/login` | Configure the active provider API key |
|
|
123
|
+
| `/logout` | Clear the active provider API key |
|
|
124
|
+
| `/mcp ...` | Browse, install, add, create, login, or remove MCP servers |
|
|
125
|
+
| `/permissions [mode]` | Change approval mode for tools and edits |
|
|
126
|
+
| `/bg <prompt>` | Run a prompt as a background job |
|
|
127
|
+
| `/fg [job-id]` | Show output from a finished background job |
|
|
128
|
+
| `/jobs` | List background jobs |
|
|
129
|
+
| `/help` | Show the full command list |
|
|
130
|
+
|
|
131
|
+
Prompt shortcuts:
|
|
132
|
+
|
|
133
|
+
- `@path/to/file.rs` injects a file into the next prompt
|
|
134
|
+
- `@path/to/dir/` injects a directory listing
|
|
135
|
+
- `#keyword` recalls matching memory entries into context
|
|
136
|
+
|
|
137
|
+
## Skills & Plugins
|
|
138
|
+
|
|
139
|
+
Anvi has two extension layers:
|
|
140
|
+
|
|
141
|
+
- Skills are prompt-level behaviors. Built-in examples include `/review`, `/security`, `/scaffold`, `/docs`, `/debug`, and `/onboard`. Community skills can be searched and installed with `/skills search <query>` and `/skills install <name>`.
|
|
142
|
+
- Plugins are executable tools discovered from `~/.anvi/plugins`. Each plugin is a trusted local binary plus a JSON manifest, so you can add custom tools in Python, shell, Ruby, or anything else that can read JSON on stdin and print JSON on stdout.
|
|
143
|
+
|
|
144
|
+
Examples:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
/skills search ci
|
|
148
|
+
/skills install ci-pipeline
|
|
149
|
+
/skills create release-notes
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
/mcp browse
|
|
154
|
+
/mcp install github
|
|
155
|
+
/mcp create jira-sync
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For hands-on setup, see [docs/GETTING_STARTED.md](docs/GETTING_STARTED.md).
|
|
159
|
+
|
|
160
|
+
## Architecture
|
|
161
|
+
|
|
162
|
+
Anvi is a 6-crate Rust workspace:
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
anvi
|
|
166
|
+
├── mastra-core shared agent/runtime types, streaming, workflows
|
|
167
|
+
├── mastra-memory SQLite-backed sessions, tasks, and memory
|
|
168
|
+
├── mastra-providers Gemini, OpenAI, and Anthropic provider adapters
|
|
169
|
+
├── mastra-tools built-in tools, plugins, MCP, RTK, CLI-Anything
|
|
170
|
+
├── anvi-agent orchestration, planning, config, skills, approvals
|
|
171
|
+
└── anvi-tui CLI binary, REPL, commands, themes, rendering
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Rough dependency flow:
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
anvi-tui
|
|
178
|
+
-> anvi-agent
|
|
179
|
+
-> mastra-core
|
|
180
|
+
-> mastra-memory
|
|
181
|
+
-> mastra-providers
|
|
182
|
+
-> mastra-tools
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Installation Notes
|
|
186
|
+
|
|
187
|
+
- Requires a Rust toolchain with `cargo`
|
|
188
|
+
- First run creates `~/.anvi/` automatically
|
|
189
|
+
- `anvi --doctor` checks API key, provider connectivity, memory, git context, and RTK status
|
|
190
|
+
- `anvi -c` resumes your most recent session
|
|
191
|
+
- `anvi "prompt"` runs one-shot mode without entering the full REPL
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
Apache 2.0
|
package/bin/anvi
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@anvi-cli/anvi",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Terminal-native AI coding agent built in Rust, powered by Gemini",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/eagleisbatman/anvi"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/eagleisbatman/anvi",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"ai",
|
|
13
|
+
"coding",
|
|
14
|
+
"agent",
|
|
15
|
+
"terminal",
|
|
16
|
+
"cli",
|
|
17
|
+
"gemini",
|
|
18
|
+
"rust"
|
|
19
|
+
],
|
|
20
|
+
"bin": {
|
|
21
|
+
"anvi": "bin/anvi"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/",
|
|
25
|
+
"scripts/",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"@anvi-cli/anvi-darwin-arm64": "1.0.0",
|
|
31
|
+
"@anvi-cli/anvi-darwin-x64": "1.0.0",
|
|
32
|
+
"@anvi-cli/anvi-linux-x64": "1.0.0",
|
|
33
|
+
"@anvi-cli/anvi-linux-arm64": "1.0.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"postinstall": "node scripts/postinstall.js"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
|
|
8
|
+
const PLATFORM_PACKAGES = {
|
|
9
|
+
"darwin-arm64": "@anvi-cli/anvi-darwin-arm64",
|
|
10
|
+
"darwin-x64": "@anvi-cli/anvi-darwin-x64",
|
|
11
|
+
"linux-x64": "@anvi-cli/anvi-linux-x64",
|
|
12
|
+
"linux-arm64": "@anvi-cli/anvi-linux-arm64",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function main() {
|
|
16
|
+
const platform = os.platform();
|
|
17
|
+
const arch = os.arch();
|
|
18
|
+
const key = `${platform}-${arch}`;
|
|
19
|
+
const pkg = PLATFORM_PACKAGES[key];
|
|
20
|
+
|
|
21
|
+
if (!pkg) {
|
|
22
|
+
console.error(`Anvi does not support ${platform}-${arch}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let binaryPath;
|
|
27
|
+
try {
|
|
28
|
+
const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
29
|
+
const binaryName = platform === "win32" ? "anvi.exe" : "anvi";
|
|
30
|
+
binaryPath = path.join(pkgDir, "bin", binaryName);
|
|
31
|
+
} catch {
|
|
32
|
+
console.error(
|
|
33
|
+
`Failed to find the Anvi binary package for ${key}.\n` +
|
|
34
|
+
`Expected package: ${pkg}\n\n` +
|
|
35
|
+
`Try reinstalling: npm install -g @anvi-cli/anvi`
|
|
36
|
+
);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!fs.existsSync(binaryPath)) {
|
|
41
|
+
console.error(`Binary not found at ${binaryPath}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Create a launcher script in our bin/ directory
|
|
46
|
+
const binDir = path.join(__dirname, "..", "bin");
|
|
47
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
48
|
+
|
|
49
|
+
const launcherPath = path.join(binDir, "anvi");
|
|
50
|
+
|
|
51
|
+
if (platform === "win32") {
|
|
52
|
+
// Windows: create a .cmd launcher
|
|
53
|
+
fs.writeFileSync(
|
|
54
|
+
launcherPath + ".cmd",
|
|
55
|
+
`@echo off\n"${binaryPath}" %*\n`
|
|
56
|
+
);
|
|
57
|
+
} else {
|
|
58
|
+
// Unix: create a symlink or shell wrapper
|
|
59
|
+
try {
|
|
60
|
+
if (fs.existsSync(launcherPath)) fs.unlinkSync(launcherPath);
|
|
61
|
+
fs.symlinkSync(binaryPath, launcherPath);
|
|
62
|
+
} catch {
|
|
63
|
+
// Fallback to shell wrapper if symlink fails
|
|
64
|
+
fs.writeFileSync(
|
|
65
|
+
launcherPath,
|
|
66
|
+
`#!/bin/sh\nexec "${binaryPath}" "$@"\n`
|
|
67
|
+
);
|
|
68
|
+
fs.chmodSync(launcherPath, 0o755);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
main();
|