simulai-cli 2.1.0__tar.gz → 2.1.1__tar.gz

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.
@@ -0,0 +1,336 @@
1
+ Metadata-Version: 2.4
2
+ Name: simulai-cli
3
+ Version: 2.1.1
4
+ Summary: SimulAI CLI — persistent AI chat in your terminal. SmartRoute across 20+ models, Naira billing, and import your Claude Code / Codex sessions.
5
+ Author-email: Simul AI <hello@trysimulai.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://trysimulai.com
8
+ Project-URL: Documentation, https://docs.trysimulai.com
9
+ Project-URL: Repository, https://github.com/Gracemansam/simulai_client
10
+ Keywords: ai,llm,cli,nigeria,openai,claude,gemini,claude-code,codex,coding-agent,smartroute
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: typer>=0.9.0
24
+ Requires-Dist: rich>=13.0.0
25
+ Requires-Dist: httpx>=0.24.0
26
+
27
+ # SimulAI CLI
28
+
29
+ AI in your terminal. Chat that persists across your terminal and the web,
30
+ an agent that edits code in your repo, and one-command import of your
31
+ Claude Code or Codex sessions.
32
+
33
+ Pay in Naira. Switch models mid-conversation. Nothing is locked to one tool.
34
+
35
+ ---
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ pip install simulai-cli
41
+ ```
42
+
43
+ Requires Python 3.9 or newer.
44
+
45
+ **Windows note:** if `simulai` isn't found after installing, your Python
46
+ `Scripts` folder isn't on PATH. Either add it, or run everything as
47
+ `py -m simulai_cli.main <command>`.
48
+
49
+ ## Log in
50
+
51
+ ```bash
52
+ simulai login
53
+ ```
54
+
55
+ Your SimulAI account email and password — the same ones you use on the web.
56
+ Tokens are stored in `~/.simulai/` and refresh automatically, so this is a
57
+ one-time step per machine.
58
+
59
+ ```bash
60
+ simulai whoami # account, balance, current defaults
61
+ ```
62
+
63
+ > **Upgrading from v1?** You must run `simulai login` once. API keys still
64
+ > work for `analyze` and scripted use, but conversations, projects, the
65
+ > agent and imports all require a logged-in account.
66
+
67
+ ---
68
+
69
+ ## Asking questions
70
+
71
+ Start an interactive session:
72
+
73
+ ```bash
74
+ simulai chat
75
+ ```
76
+
77
+ ```
78
+ › how do I make a Postgres query with a composite unique constraint?
79
+ ```
80
+
81
+ **Follow-up questions just work — keep typing.** The session holds the full
82
+ conversation, so "what about partial indexes?" or "show me that in
83
+ SQLAlchemy" understands what you were talking about.
84
+
85
+ Press `Ctrl+C` or type `/exit` when done. Nothing is lost — the conversation
86
+ is saved and appears in the web app at trysimulai.com, where you can pick it
87
+ up later. Come back to the same folder and `simulai chat` resumes it.
88
+
89
+ One-shot, no session:
90
+
91
+ ```bash
92
+ simulai chat "explain this error: IntegrityError duplicate key"
93
+ ```
94
+
95
+ Attach files:
96
+
97
+ ```bash
98
+ simulai chat -f app/models.py -f app/schema.sql "why is this insert failing?"
99
+ ```
100
+
101
+ Search the live web:
102
+
103
+ ```bash
104
+ simulai chat --web "what changed in Postgres 18?"
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Choosing a model
110
+
111
+ By default **SmartRoute** picks a model per message — cheap ones for simple
112
+ questions, stronger ones for hard problems. You don't have to think about it.
113
+
114
+ Browse what's available:
115
+
116
+ ```bash
117
+ simulai models # everything
118
+ simulai models claude # filter
119
+ ```
120
+
121
+ Pick one for a session:
122
+
123
+ ```bash
124
+ simulai chat -m anthropic/claude-sonnet-4-6
125
+ ```
126
+
127
+ Or switch mid-conversation without losing context:
128
+
129
+ ```
130
+ › /model openai/gpt-4o
131
+ › /smart ← hand routing back to SmartRoute
132
+ ```
133
+
134
+ Control effort instead of naming a model:
135
+
136
+ ```bash
137
+ simulai chat -e fast # cheapest capable
138
+ simulai chat -e max # one tier up
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Coding in your repo
144
+
145
+ ```bash
146
+ cd ~/code/my-project
147
+ simulai code "the login endpoint returns 500 when email is missing — fix it"
148
+ ```
149
+
150
+ The agent greps your code, reads the relevant files, and proposes edits.
151
+ **You approve every change as a diff before it touches disk:**
152
+
153
+ ```
154
+ ╭─────────────── Edit app/api/auth.py ────────────────╮
155
+ │ --- a/app/api/auth.py │
156
+ │ +++ b/app/api/auth.py │
157
+ │ @@ -42,6 +42,8 @@ │
158
+ │ def login(body: LoginRequest): │
159
+ │ + if not body.email: │
160
+ │ + raise HTTPException(422, "email required") │
161
+ ╰─────────────────────────────────────────────────────╯
162
+ Apply? [y/n/a] (y):
163
+ ```
164
+
165
+ `y` applies it, `n` declines and tells the agent to try something else,
166
+ `a` auto-approves the rest of this run.
167
+
168
+ After edits it runs your test suite and fixes what it broke.
169
+
170
+ **Useful flags:**
171
+
172
+ ```bash
173
+ simulai code --dry-run "..." # show what would change, write nothing
174
+ simulai code -y "..." # skip approval prompts
175
+ simulai code -m <model> "..." # pick the model yourself
176
+ simulai code --no-verify "..." # skip the post-edit test run
177
+ simulai code -d path/to/sub "..." # limit it to a subfolder
178
+ simulai code -c "..." # carry facts from earlier runs here
179
+ simulai code --save "..." # keep a record in the web app
180
+ ```
181
+
182
+ **Safety:** it can't touch files outside the folder you ran it in,
183
+ destructive shell commands are blocked, every edit is syntax-checked before
184
+ it's written, and it warns you if your git tree has uncommitted work.
185
+
186
+ ### Project instructions
187
+
188
+ Put a `SIMULAI.md` at your repo root and every run reads it:
189
+
190
+ ```markdown
191
+ # Conventions
192
+ - Python 3.11, snake_case, type hints on public functions
193
+ - Tests: pytest -q
194
+ - Never edit files under migrations/
195
+ - API routes go in app/api/routes/, business logic in app/services/
196
+ ```
197
+
198
+ `AGENTS.md` and `CLAUDE.md` work too, so an existing file from another tool
199
+ is picked up as-is. This is the reliable way to give the agent your
200
+ conventions — a file you write, review and commit.
201
+
202
+ ### Follow-ups while coding
203
+
204
+ Within a run the agent keeps full context across every step. **Between runs
205
+ it starts fresh**, like Claude Code and Codex.
206
+
207
+ To carry forward what earlier runs did:
208
+
209
+ ```bash
210
+ simulai code "add an email check to the login endpoint"
211
+ simulai code -c "now do the same for the password field"
212
+ ```
213
+
214
+ `--continue` passes forward the facts — which files changed, which commands
215
+ ran — not a narrative. It stays on your machine; nothing is uploaded.
216
+
217
+ Without `-c` each run is independent, which is usually what you want: an
218
+ unrelated task doesn't need last week's context, and carrying it costs
219
+ tokens and can pull the model toward the wrong files.
220
+
221
+ To keep a record in the web app:
222
+
223
+ ```bash
224
+ simulai code --save "task"
225
+ ```
226
+
227
+ For anything exploratory, use `simulai chat` (which does remember
228
+ conversationally) to work out what you want, then `simulai code` to do it.
229
+
230
+ ---
231
+
232
+ ## Bringing conversations with you
233
+
234
+ Hit a limit in Claude Code? Bring the session over and keep going on any
235
+ model:
236
+
237
+ ```bash
238
+ cd ~/code/my-project
239
+ simulai import claude-code
240
+ ```
241
+
242
+ It shows **this repo's** recent sessions — not a month of every project —
243
+ and you pick one:
244
+
245
+ ```
246
+ # When Tool Opening prompt Scope
247
+ 1 today claude-code fix the streaming timeout exact
248
+ 2 2.1d ago claude-code add rate limiting to the API exact
249
+ ```
250
+
251
+ Then `simulai chat` continues it. The tool noise is stripped on import, so
252
+ picking up where you left off costs a fraction of the original session.
253
+
254
+ Other sources:
255
+
256
+ ```bash
257
+ simulai import codex # Codex CLI sessions
258
+ simulai import scan # check every supported tool
259
+ simulai import file export.json # a ChatGPT/Claude/Gemini export
260
+ simulai import link <share-url> # a public share link
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Watching what you spend
266
+
267
+ Every reply ends with its token count. For the ledger:
268
+
269
+ ```bash
270
+ simulai wallet # balance
271
+ simulai usage # what you spent, on what
272
+ ```
273
+
274
+ Inside a chat, `/cost` shows the balance and this conversation's spend.
275
+
276
+ **Keeping costs down:** long conversations re-send their history every turn,
277
+ so `/trim` drops older messages from context (they stay saved), and `/new`
278
+ starts fresh. For the agent, narrow tasks cost far less than open-ended ones
279
+ — "fix the null check in wallet.py" beats "review my architecture".
280
+
281
+ ---
282
+
283
+ ## Command reference
284
+
285
+ | Command | What it does |
286
+ |---|---|
287
+ | `simulai login` | Log in |
288
+ | `simulai chat` | Resume this folder's conversation |
289
+ | `simulai chat "msg"` | One-shot question |
290
+ | `simulai code "task"` | Agentic coding in this repo |
291
+ | `simulai chats` | List your conversations |
292
+ | `simulai resume` | Pick a conversation to continue here |
293
+ | `simulai models [filter]` | Browse models |
294
+ | `simulai projects` | List your projects |
295
+ | `simulai analyze file.py` | Review a single file |
296
+ | `simulai analyze file.py --edit` | Review and rewrite it in place |
297
+ | `simulai import claude-code` | Import a Claude Code session |
298
+ | `simulai wallet` / `simulai usage` | Balance and spending |
299
+ | `simulai config effort max` | Change a default |
300
+ | `simulai whoami` | Account and settings |
301
+
302
+ ### Inside a chat session
303
+
304
+ | Command | What it does |
305
+ |---|---|
306
+ | `/model <id>` | Switch model (turns SmartRoute off) |
307
+ | `/models [filter]` | Browse models |
308
+ | `/smart` | Hand routing back to SmartRoute |
309
+ | `/effort fast\|balanced\|max` | Change effort level |
310
+ | `/web` | Toggle live web search |
311
+ | `/mode code\|general\|marketing\|study` | Change mode |
312
+ | `/project` | Attach this chat to a project |
313
+ | `/file <path>` | Attach a file to your next message |
314
+ | `/code` | Re-show code blocks from the last reply |
315
+ | `/save <file>` | Save the last reply |
316
+ | `/new [title]` | Start a fresh conversation |
317
+ | `/trim [n]` | Shrink context to the last n messages |
318
+ | `/cost` · `/usage` | Spending |
319
+ | `/help` · `/exit` | Help, and leave |
320
+
321
+ ---
322
+
323
+ ## Where things are stored
324
+
325
+ ```
326
+ ~/.simulai/config.json settings and defaults
327
+ ~/.simulai/auth.json login tokens
328
+ ~/.simulai/state.json which conversation belongs to which folder
329
+ ```
330
+
331
+ Conversations live on your SimulAI account, so they're available on the web
332
+ and on any machine you log in from.
333
+
334
+ ---
335
+
336
+ [trysimulai.com](https://trysimulai.com) · MIT licensed
@@ -0,0 +1,310 @@
1
+ # SimulAI CLI
2
+
3
+ AI in your terminal. Chat that persists across your terminal and the web,
4
+ an agent that edits code in your repo, and one-command import of your
5
+ Claude Code or Codex sessions.
6
+
7
+ Pay in Naira. Switch models mid-conversation. Nothing is locked to one tool.
8
+
9
+ ---
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install simulai-cli
15
+ ```
16
+
17
+ Requires Python 3.9 or newer.
18
+
19
+ **Windows note:** if `simulai` isn't found after installing, your Python
20
+ `Scripts` folder isn't on PATH. Either add it, or run everything as
21
+ `py -m simulai_cli.main <command>`.
22
+
23
+ ## Log in
24
+
25
+ ```bash
26
+ simulai login
27
+ ```
28
+
29
+ Your SimulAI account email and password — the same ones you use on the web.
30
+ Tokens are stored in `~/.simulai/` and refresh automatically, so this is a
31
+ one-time step per machine.
32
+
33
+ ```bash
34
+ simulai whoami # account, balance, current defaults
35
+ ```
36
+
37
+ > **Upgrading from v1?** You must run `simulai login` once. API keys still
38
+ > work for `analyze` and scripted use, but conversations, projects, the
39
+ > agent and imports all require a logged-in account.
40
+
41
+ ---
42
+
43
+ ## Asking questions
44
+
45
+ Start an interactive session:
46
+
47
+ ```bash
48
+ simulai chat
49
+ ```
50
+
51
+ ```
52
+ › how do I make a Postgres query with a composite unique constraint?
53
+ ```
54
+
55
+ **Follow-up questions just work — keep typing.** The session holds the full
56
+ conversation, so "what about partial indexes?" or "show me that in
57
+ SQLAlchemy" understands what you were talking about.
58
+
59
+ Press `Ctrl+C` or type `/exit` when done. Nothing is lost — the conversation
60
+ is saved and appears in the web app at trysimulai.com, where you can pick it
61
+ up later. Come back to the same folder and `simulai chat` resumes it.
62
+
63
+ One-shot, no session:
64
+
65
+ ```bash
66
+ simulai chat "explain this error: IntegrityError duplicate key"
67
+ ```
68
+
69
+ Attach files:
70
+
71
+ ```bash
72
+ simulai chat -f app/models.py -f app/schema.sql "why is this insert failing?"
73
+ ```
74
+
75
+ Search the live web:
76
+
77
+ ```bash
78
+ simulai chat --web "what changed in Postgres 18?"
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Choosing a model
84
+
85
+ By default **SmartRoute** picks a model per message — cheap ones for simple
86
+ questions, stronger ones for hard problems. You don't have to think about it.
87
+
88
+ Browse what's available:
89
+
90
+ ```bash
91
+ simulai models # everything
92
+ simulai models claude # filter
93
+ ```
94
+
95
+ Pick one for a session:
96
+
97
+ ```bash
98
+ simulai chat -m anthropic/claude-sonnet-4-6
99
+ ```
100
+
101
+ Or switch mid-conversation without losing context:
102
+
103
+ ```
104
+ › /model openai/gpt-4o
105
+ › /smart ← hand routing back to SmartRoute
106
+ ```
107
+
108
+ Control effort instead of naming a model:
109
+
110
+ ```bash
111
+ simulai chat -e fast # cheapest capable
112
+ simulai chat -e max # one tier up
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Coding in your repo
118
+
119
+ ```bash
120
+ cd ~/code/my-project
121
+ simulai code "the login endpoint returns 500 when email is missing — fix it"
122
+ ```
123
+
124
+ The agent greps your code, reads the relevant files, and proposes edits.
125
+ **You approve every change as a diff before it touches disk:**
126
+
127
+ ```
128
+ ╭─────────────── Edit app/api/auth.py ────────────────╮
129
+ │ --- a/app/api/auth.py │
130
+ │ +++ b/app/api/auth.py │
131
+ │ @@ -42,6 +42,8 @@ │
132
+ │ def login(body: LoginRequest): │
133
+ │ + if not body.email: │
134
+ │ + raise HTTPException(422, "email required") │
135
+ ╰─────────────────────────────────────────────────────╯
136
+ Apply? [y/n/a] (y):
137
+ ```
138
+
139
+ `y` applies it, `n` declines and tells the agent to try something else,
140
+ `a` auto-approves the rest of this run.
141
+
142
+ After edits it runs your test suite and fixes what it broke.
143
+
144
+ **Useful flags:**
145
+
146
+ ```bash
147
+ simulai code --dry-run "..." # show what would change, write nothing
148
+ simulai code -y "..." # skip approval prompts
149
+ simulai code -m <model> "..." # pick the model yourself
150
+ simulai code --no-verify "..." # skip the post-edit test run
151
+ simulai code -d path/to/sub "..." # limit it to a subfolder
152
+ simulai code -c "..." # carry facts from earlier runs here
153
+ simulai code --save "..." # keep a record in the web app
154
+ ```
155
+
156
+ **Safety:** it can't touch files outside the folder you ran it in,
157
+ destructive shell commands are blocked, every edit is syntax-checked before
158
+ it's written, and it warns you if your git tree has uncommitted work.
159
+
160
+ ### Project instructions
161
+
162
+ Put a `SIMULAI.md` at your repo root and every run reads it:
163
+
164
+ ```markdown
165
+ # Conventions
166
+ - Python 3.11, snake_case, type hints on public functions
167
+ - Tests: pytest -q
168
+ - Never edit files under migrations/
169
+ - API routes go in app/api/routes/, business logic in app/services/
170
+ ```
171
+
172
+ `AGENTS.md` and `CLAUDE.md` work too, so an existing file from another tool
173
+ is picked up as-is. This is the reliable way to give the agent your
174
+ conventions — a file you write, review and commit.
175
+
176
+ ### Follow-ups while coding
177
+
178
+ Within a run the agent keeps full context across every step. **Between runs
179
+ it starts fresh**, like Claude Code and Codex.
180
+
181
+ To carry forward what earlier runs did:
182
+
183
+ ```bash
184
+ simulai code "add an email check to the login endpoint"
185
+ simulai code -c "now do the same for the password field"
186
+ ```
187
+
188
+ `--continue` passes forward the facts — which files changed, which commands
189
+ ran — not a narrative. It stays on your machine; nothing is uploaded.
190
+
191
+ Without `-c` each run is independent, which is usually what you want: an
192
+ unrelated task doesn't need last week's context, and carrying it costs
193
+ tokens and can pull the model toward the wrong files.
194
+
195
+ To keep a record in the web app:
196
+
197
+ ```bash
198
+ simulai code --save "task"
199
+ ```
200
+
201
+ For anything exploratory, use `simulai chat` (which does remember
202
+ conversationally) to work out what you want, then `simulai code` to do it.
203
+
204
+ ---
205
+
206
+ ## Bringing conversations with you
207
+
208
+ Hit a limit in Claude Code? Bring the session over and keep going on any
209
+ model:
210
+
211
+ ```bash
212
+ cd ~/code/my-project
213
+ simulai import claude-code
214
+ ```
215
+
216
+ It shows **this repo's** recent sessions — not a month of every project —
217
+ and you pick one:
218
+
219
+ ```
220
+ # When Tool Opening prompt Scope
221
+ 1 today claude-code fix the streaming timeout exact
222
+ 2 2.1d ago claude-code add rate limiting to the API exact
223
+ ```
224
+
225
+ Then `simulai chat` continues it. The tool noise is stripped on import, so
226
+ picking up where you left off costs a fraction of the original session.
227
+
228
+ Other sources:
229
+
230
+ ```bash
231
+ simulai import codex # Codex CLI sessions
232
+ simulai import scan # check every supported tool
233
+ simulai import file export.json # a ChatGPT/Claude/Gemini export
234
+ simulai import link <share-url> # a public share link
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Watching what you spend
240
+
241
+ Every reply ends with its token count. For the ledger:
242
+
243
+ ```bash
244
+ simulai wallet # balance
245
+ simulai usage # what you spent, on what
246
+ ```
247
+
248
+ Inside a chat, `/cost` shows the balance and this conversation's spend.
249
+
250
+ **Keeping costs down:** long conversations re-send their history every turn,
251
+ so `/trim` drops older messages from context (they stay saved), and `/new`
252
+ starts fresh. For the agent, narrow tasks cost far less than open-ended ones
253
+ — "fix the null check in wallet.py" beats "review my architecture".
254
+
255
+ ---
256
+
257
+ ## Command reference
258
+
259
+ | Command | What it does |
260
+ |---|---|
261
+ | `simulai login` | Log in |
262
+ | `simulai chat` | Resume this folder's conversation |
263
+ | `simulai chat "msg"` | One-shot question |
264
+ | `simulai code "task"` | Agentic coding in this repo |
265
+ | `simulai chats` | List your conversations |
266
+ | `simulai resume` | Pick a conversation to continue here |
267
+ | `simulai models [filter]` | Browse models |
268
+ | `simulai projects` | List your projects |
269
+ | `simulai analyze file.py` | Review a single file |
270
+ | `simulai analyze file.py --edit` | Review and rewrite it in place |
271
+ | `simulai import claude-code` | Import a Claude Code session |
272
+ | `simulai wallet` / `simulai usage` | Balance and spending |
273
+ | `simulai config effort max` | Change a default |
274
+ | `simulai whoami` | Account and settings |
275
+
276
+ ### Inside a chat session
277
+
278
+ | Command | What it does |
279
+ |---|---|
280
+ | `/model <id>` | Switch model (turns SmartRoute off) |
281
+ | `/models [filter]` | Browse models |
282
+ | `/smart` | Hand routing back to SmartRoute |
283
+ | `/effort fast\|balanced\|max` | Change effort level |
284
+ | `/web` | Toggle live web search |
285
+ | `/mode code\|general\|marketing\|study` | Change mode |
286
+ | `/project` | Attach this chat to a project |
287
+ | `/file <path>` | Attach a file to your next message |
288
+ | `/code` | Re-show code blocks from the last reply |
289
+ | `/save <file>` | Save the last reply |
290
+ | `/new [title]` | Start a fresh conversation |
291
+ | `/trim [n]` | Shrink context to the last n messages |
292
+ | `/cost` · `/usage` | Spending |
293
+ | `/help` · `/exit` | Help, and leave |
294
+
295
+ ---
296
+
297
+ ## Where things are stored
298
+
299
+ ```
300
+ ~/.simulai/config.json settings and defaults
301
+ ~/.simulai/auth.json login tokens
302
+ ~/.simulai/state.json which conversation belongs to which folder
303
+ ```
304
+
305
+ Conversations live on your SimulAI account, so they're available on the web
306
+ and on any machine you log in from.
307
+
308
+ ---
309
+
310
+ [trysimulai.com](https://trysimulai.com) · MIT licensed
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simulai-cli"
7
- version = "2.1.0"
7
+ version = "2.1.1"
8
8
  description = "SimulAI CLI — persistent AI chat in your terminal. SmartRoute across 20+ models, Naira billing, and import your Claude Code / Codex sessions."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }