meshapi-code 0.3.0__tar.gz → 0.3.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.
- meshapi_code-0.3.1/PKG-INFO +155 -0
- meshapi_code-0.3.1/README.md +128 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/pyproject.toml +1 -1
- meshapi_code-0.3.1/src/meshapi/__init__.py +1 -0
- meshapi_code-0.3.0/PKG-INFO +0 -112
- meshapi_code-0.3.0/README.md +0 -85
- meshapi_code-0.3.0/src/meshapi/__init__.py +0 -1
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/.github/workflows/publish.yml +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/.gitignore +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/CLAUDE.md +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/LICENSE +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/__main__.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/cli.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/client.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/commands.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/config.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/permissions.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/render.py +0 -0
- {meshapi_code-0.3.0 → meshapi_code-0.3.1}/src/meshapi/tools.py +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meshapi-code
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Terminal chat for Mesh API — OpenAI-compatible LLM gateway
|
|
5
|
+
Project-URL: Homepage, https://meshapi.ai
|
|
6
|
+
Project-URL: Documentation, https://docs.meshapi.ai
|
|
7
|
+
Project-URL: Repository, https://github.com/aifiesta/meshapi-code
|
|
8
|
+
Author: Mesh API
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: anthropic,chat,cli,gateway,llm,mesh,openai
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: httpx>=0.27
|
|
24
|
+
Requires-Dist: prompt-toolkit>=3.0
|
|
25
|
+
Requires-Dist: rich>=13.7
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# meshapi-code
|
|
29
|
+
|
|
30
|
+
Terminal chat REPL for [Mesh API](https://meshapi.ai) — one OpenAI-compatible key, 300+ models. Streaming responses, live markdown, file/shell tool calls with approval, real-time cost.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
$ meshapi
|
|
34
|
+
███╗ ███╗███████╗███████╗██╗ ██╗ ✦ meshapi 0.3.0
|
|
35
|
+
████╗ ████║██╔════╝██╔════╝██║ ██║ cwd: ~/code/myproj
|
|
36
|
+
██╔████╔██║█████╗ ███████╗███████║ model: anthropic/claude-sonnet-4.5
|
|
37
|
+
██║╚██╔╝██║██╔══╝ ╚════██║██╔══██║ route: cheapest
|
|
38
|
+
██║ ╚═╝ ██║███████╗███████║██║ ██║
|
|
39
|
+
╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
|
40
|
+
type /help for commands, /exit to quit
|
|
41
|
+
|
|
42
|
+
› add a healthcheck endpoint to server.py and run the tests
|
|
43
|
+
… streamed markdown reply …
|
|
44
|
+
⚙ approve tool call? write_file: server.py (1240 chars) y/n › y
|
|
45
|
+
⚙ approve tool call? run_bash: pytest -q y/n › y
|
|
46
|
+
anthropic/claude-sonnet-4.5 • 942→318 tok • $0.001234 • session $0.001234
|
|
47
|
+
mode: approve each model can request file/shell ops; you confirm each one shift+tab to cycle
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pipx install meshapi-code # recommended
|
|
54
|
+
uv tool install meshapi-code # if you use uv
|
|
55
|
+
pip install meshapi-code # plain pip
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
PyPI package is `meshapi-code`; the command on your `$PATH` is `meshapi` (same split Claude Code uses: `@anthropic-ai/claude-code` → `claude`).
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
export MESHAPI_API_KEY=rsk_your_key_here
|
|
62
|
+
meshapi
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Get a key at [meshapi.ai](https://meshapi.ai).
|
|
66
|
+
|
|
67
|
+
## What it does
|
|
68
|
+
|
|
69
|
+
- **Streaming completions** with live markdown rendering (`rich`).
|
|
70
|
+
- **Real cost per turn** — Mesh returns `cost` in the SSE tail; we surface it after every reply and accumulate `session $…`.
|
|
71
|
+
- **Tool calling** — the model can read files, write files, and run shell commands in the launch directory. Off by default behind an approval prompt; toggle with one key.
|
|
72
|
+
- **Permission modes** — `approve each` (default), `bypass perms` (auto-execute, for trusted prompts), or `no access` (chat only). Cycle live with **Shift+Tab**.
|
|
73
|
+
- **Mid-session switching** — `/model openai/gpt-4o-mini`, `/route cheapest`, `/mode bypass`.
|
|
74
|
+
- **Smart routing** — `/route cheapest|fastest|balanced` hands model selection to Mesh's gateway, so you don't have to.
|
|
75
|
+
- **Persistent input history** — up-arrow recalls past prompts across sessions.
|
|
76
|
+
- **Config + env-var override** — `~/.meshapi/config.json`, `MESHAPI_API_KEY`.
|
|
77
|
+
|
|
78
|
+
## Tool calling
|
|
79
|
+
|
|
80
|
+
When tools are enabled, the model can call:
|
|
81
|
+
|
|
82
|
+
| Tool | What it does |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `read_file` | Read a file from the working directory (or absolute path). |
|
|
85
|
+
| `write_file` | Create or overwrite a file. Parent dirs are created. |
|
|
86
|
+
| `run_bash` | Run a shell command in the working directory. 60s timeout, 8000-char output cap. |
|
|
87
|
+
|
|
88
|
+
The launch CWD is baked into the system prompt, so relative paths the model produces resolve where you'd expect. Three permission modes, cycled live with Shift+Tab or set with `--mode` / `/mode`:
|
|
89
|
+
|
|
90
|
+
- **`ask`** (default) — every tool call requires a `y/n` confirmation. Safe.
|
|
91
|
+
- **`bypass`** — the model auto-executes. Fast, like Claude Code's `--dangerously-skip-permissions`. Use only when you trust the prompt.
|
|
92
|
+
- **`none`** — tools aren't sent to the model at all. Pure chat.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
meshapi --mode bypass # start in auto-execute mode
|
|
96
|
+
meshapi # default ask; press Shift+Tab to cycle
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Slash commands
|
|
100
|
+
|
|
101
|
+
| Command | What it does |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `/help` | List commands |
|
|
104
|
+
| `/model <name>` | Switch model (e.g. `anthropic/claude-sonnet-4.5`, `openai/gpt-4o-mini`) |
|
|
105
|
+
| `/route <mode>` | `cheapest`, `fastest`, `balanced`, or `default` |
|
|
106
|
+
| `/mode <perm>` | `ask`, `bypass`, or `none` (Shift+Tab also cycles) |
|
|
107
|
+
| `/file <path>` | Inject a file into the conversation |
|
|
108
|
+
| `/system <text>` | Replace system prompt and reset chat |
|
|
109
|
+
| `/cost` | Show cumulative session spend |
|
|
110
|
+
| `/clear` | Reset conversation |
|
|
111
|
+
| `/exit` | Quit |
|
|
112
|
+
|
|
113
|
+
## Config
|
|
114
|
+
|
|
115
|
+
`~/.meshapi/config.json`:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"base_url": "https://api.meshapi.ai/v1",
|
|
120
|
+
"model": "anthropic/claude-sonnet-4.5",
|
|
121
|
+
"system": "You are a helpful coding assistant. Be concise.",
|
|
122
|
+
"route": null
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The API key is read from `MESHAPI_API_KEY` (preferred) or stored in the same file. Input history lives at `~/.meshapi/history`.
|
|
127
|
+
|
|
128
|
+
## About Mesh API
|
|
129
|
+
|
|
130
|
+
[Mesh API](https://meshapi.ai) is a unified LLM gateway: one API key, 300+ models from OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, Alibaba, and more. It's OpenAI-compatible — change the model name in your request, leave everything else alone.
|
|
131
|
+
|
|
132
|
+
- **Zero platform fees for 12 months.** You only pay for tokens.
|
|
133
|
+
- **Smart auto routing.** `route: cheapest|fastest|balanced` and the gateway picks for you.
|
|
134
|
+
- **Automatic failover.** If a provider goes down, your request routes to another. Your users won't know.
|
|
135
|
+
- **Highest rate limits.** Capacity is pooled across providers, so you hit ceilings later than going direct.
|
|
136
|
+
- **Zero data retention.** Prompts and completions pass through; we don't store them.
|
|
137
|
+
- **Multi-currency billing.** USD and INR (for India-based teams) at launch.
|
|
138
|
+
- **Ready-made workflows.** Pre-built prompt templates you can plug into any model.
|
|
139
|
+
- **Full observability.** Every request, token, cost, error, and model usage tracked in real time. Per-key spending limits and usage controls.
|
|
140
|
+
|
|
141
|
+
Built by the founders of [TagMango](https://tagmango.com) (YC W20) and [AI Fiesta](https://aifiesta.ai) (1M+ users across India). We got tired of managing five different provider dashboards ourselves, so we built this.
|
|
142
|
+
|
|
143
|
+
## Why this CLI exists
|
|
144
|
+
|
|
145
|
+
Any generic OpenAI-compatible chat CLI talks to Mesh. `meshapi` adds three things a generic CLI can't: (1) the gateway-only `cost` field shown after every turn, (2) `/route` controls that drive Mesh's gateway-side model selection, and (3) tool calling that resolves paths against the directory you launched from.
|
|
146
|
+
|
|
147
|
+
## Roadmap
|
|
148
|
+
|
|
149
|
+
- ✅ v0.3 — tool calling, ask/bypass/none permission modes, CWD-aware system prompt
|
|
150
|
+
- v0.4 — repo-aware mode, diff apply, `/cd` to change working dir mid-session
|
|
151
|
+
- v0.5 — `npm i -g meshapi-code` (Node port using `ink` + `chalk`), Homebrew tap, curl|sh installer at `meshapi.ai/install.sh`
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
MIT
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# meshapi-code
|
|
2
|
+
|
|
3
|
+
Terminal chat REPL for [Mesh API](https://meshapi.ai) — one OpenAI-compatible key, 300+ models. Streaming responses, live markdown, file/shell tool calls with approval, real-time cost.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
$ meshapi
|
|
7
|
+
███╗ ███╗███████╗███████╗██╗ ██╗ ✦ meshapi 0.3.0
|
|
8
|
+
████╗ ████║██╔════╝██╔════╝██║ ██║ cwd: ~/code/myproj
|
|
9
|
+
██╔████╔██║█████╗ ███████╗███████║ model: anthropic/claude-sonnet-4.5
|
|
10
|
+
██║╚██╔╝██║██╔══╝ ╚════██║██╔══██║ route: cheapest
|
|
11
|
+
██║ ╚═╝ ██║███████╗███████║██║ ██║
|
|
12
|
+
╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
|
13
|
+
type /help for commands, /exit to quit
|
|
14
|
+
|
|
15
|
+
› add a healthcheck endpoint to server.py and run the tests
|
|
16
|
+
… streamed markdown reply …
|
|
17
|
+
⚙ approve tool call? write_file: server.py (1240 chars) y/n › y
|
|
18
|
+
⚙ approve tool call? run_bash: pytest -q y/n › y
|
|
19
|
+
anthropic/claude-sonnet-4.5 • 942→318 tok • $0.001234 • session $0.001234
|
|
20
|
+
mode: approve each model can request file/shell ops; you confirm each one shift+tab to cycle
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pipx install meshapi-code # recommended
|
|
27
|
+
uv tool install meshapi-code # if you use uv
|
|
28
|
+
pip install meshapi-code # plain pip
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
PyPI package is `meshapi-code`; the command on your `$PATH` is `meshapi` (same split Claude Code uses: `@anthropic-ai/claude-code` → `claude`).
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
export MESHAPI_API_KEY=rsk_your_key_here
|
|
35
|
+
meshapi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Get a key at [meshapi.ai](https://meshapi.ai).
|
|
39
|
+
|
|
40
|
+
## What it does
|
|
41
|
+
|
|
42
|
+
- **Streaming completions** with live markdown rendering (`rich`).
|
|
43
|
+
- **Real cost per turn** — Mesh returns `cost` in the SSE tail; we surface it after every reply and accumulate `session $…`.
|
|
44
|
+
- **Tool calling** — the model can read files, write files, and run shell commands in the launch directory. Off by default behind an approval prompt; toggle with one key.
|
|
45
|
+
- **Permission modes** — `approve each` (default), `bypass perms` (auto-execute, for trusted prompts), or `no access` (chat only). Cycle live with **Shift+Tab**.
|
|
46
|
+
- **Mid-session switching** — `/model openai/gpt-4o-mini`, `/route cheapest`, `/mode bypass`.
|
|
47
|
+
- **Smart routing** — `/route cheapest|fastest|balanced` hands model selection to Mesh's gateway, so you don't have to.
|
|
48
|
+
- **Persistent input history** — up-arrow recalls past prompts across sessions.
|
|
49
|
+
- **Config + env-var override** — `~/.meshapi/config.json`, `MESHAPI_API_KEY`.
|
|
50
|
+
|
|
51
|
+
## Tool calling
|
|
52
|
+
|
|
53
|
+
When tools are enabled, the model can call:
|
|
54
|
+
|
|
55
|
+
| Tool | What it does |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `read_file` | Read a file from the working directory (or absolute path). |
|
|
58
|
+
| `write_file` | Create or overwrite a file. Parent dirs are created. |
|
|
59
|
+
| `run_bash` | Run a shell command in the working directory. 60s timeout, 8000-char output cap. |
|
|
60
|
+
|
|
61
|
+
The launch CWD is baked into the system prompt, so relative paths the model produces resolve where you'd expect. Three permission modes, cycled live with Shift+Tab or set with `--mode` / `/mode`:
|
|
62
|
+
|
|
63
|
+
- **`ask`** (default) — every tool call requires a `y/n` confirmation. Safe.
|
|
64
|
+
- **`bypass`** — the model auto-executes. Fast, like Claude Code's `--dangerously-skip-permissions`. Use only when you trust the prompt.
|
|
65
|
+
- **`none`** — tools aren't sent to the model at all. Pure chat.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
meshapi --mode bypass # start in auto-execute mode
|
|
69
|
+
meshapi # default ask; press Shift+Tab to cycle
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Slash commands
|
|
73
|
+
|
|
74
|
+
| Command | What it does |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `/help` | List commands |
|
|
77
|
+
| `/model <name>` | Switch model (e.g. `anthropic/claude-sonnet-4.5`, `openai/gpt-4o-mini`) |
|
|
78
|
+
| `/route <mode>` | `cheapest`, `fastest`, `balanced`, or `default` |
|
|
79
|
+
| `/mode <perm>` | `ask`, `bypass`, or `none` (Shift+Tab also cycles) |
|
|
80
|
+
| `/file <path>` | Inject a file into the conversation |
|
|
81
|
+
| `/system <text>` | Replace system prompt and reset chat |
|
|
82
|
+
| `/cost` | Show cumulative session spend |
|
|
83
|
+
| `/clear` | Reset conversation |
|
|
84
|
+
| `/exit` | Quit |
|
|
85
|
+
|
|
86
|
+
## Config
|
|
87
|
+
|
|
88
|
+
`~/.meshapi/config.json`:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"base_url": "https://api.meshapi.ai/v1",
|
|
93
|
+
"model": "anthropic/claude-sonnet-4.5",
|
|
94
|
+
"system": "You are a helpful coding assistant. Be concise.",
|
|
95
|
+
"route": null
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The API key is read from `MESHAPI_API_KEY` (preferred) or stored in the same file. Input history lives at `~/.meshapi/history`.
|
|
100
|
+
|
|
101
|
+
## About Mesh API
|
|
102
|
+
|
|
103
|
+
[Mesh API](https://meshapi.ai) is a unified LLM gateway: one API key, 300+ models from OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, Alibaba, and more. It's OpenAI-compatible — change the model name in your request, leave everything else alone.
|
|
104
|
+
|
|
105
|
+
- **Zero platform fees for 12 months.** You only pay for tokens.
|
|
106
|
+
- **Smart auto routing.** `route: cheapest|fastest|balanced` and the gateway picks for you.
|
|
107
|
+
- **Automatic failover.** If a provider goes down, your request routes to another. Your users won't know.
|
|
108
|
+
- **Highest rate limits.** Capacity is pooled across providers, so you hit ceilings later than going direct.
|
|
109
|
+
- **Zero data retention.** Prompts and completions pass through; we don't store them.
|
|
110
|
+
- **Multi-currency billing.** USD and INR (for India-based teams) at launch.
|
|
111
|
+
- **Ready-made workflows.** Pre-built prompt templates you can plug into any model.
|
|
112
|
+
- **Full observability.** Every request, token, cost, error, and model usage tracked in real time. Per-key spending limits and usage controls.
|
|
113
|
+
|
|
114
|
+
Built by the founders of [TagMango](https://tagmango.com) (YC W20) and [AI Fiesta](https://aifiesta.ai) (1M+ users across India). We got tired of managing five different provider dashboards ourselves, so we built this.
|
|
115
|
+
|
|
116
|
+
## Why this CLI exists
|
|
117
|
+
|
|
118
|
+
Any generic OpenAI-compatible chat CLI talks to Mesh. `meshapi` adds three things a generic CLI can't: (1) the gateway-only `cost` field shown after every turn, (2) `/route` controls that drive Mesh's gateway-side model selection, and (3) tool calling that resolves paths against the directory you launched from.
|
|
119
|
+
|
|
120
|
+
## Roadmap
|
|
121
|
+
|
|
122
|
+
- ✅ v0.3 — tool calling, ask/bypass/none permission modes, CWD-aware system prompt
|
|
123
|
+
- v0.4 — repo-aware mode, diff apply, `/cd` to change working dir mid-session
|
|
124
|
+
- v0.5 — `npm i -g meshapi-code` (Node port using `ink` + `chalk`), Homebrew tap, curl|sh installer at `meshapi.ai/install.sh`
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.1"
|
meshapi_code-0.3.0/PKG-INFO
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: meshapi-code
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Terminal chat for Mesh API — OpenAI-compatible LLM gateway
|
|
5
|
-
Project-URL: Homepage, https://meshapi.ai
|
|
6
|
-
Project-URL: Documentation, https://docs.meshapi.ai
|
|
7
|
-
Project-URL: Repository, https://github.com/aifiesta/meshapi-code
|
|
8
|
-
Author: Mesh API
|
|
9
|
-
License: MIT
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: anthropic,chat,cli,gateway,llm,mesh,openai
|
|
12
|
-
Classifier: Development Status :: 3 - Alpha
|
|
13
|
-
Classifier: Environment :: Console
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
-
Classifier: Topic :: Software Development
|
|
22
|
-
Requires-Python: >=3.10
|
|
23
|
-
Requires-Dist: httpx>=0.27
|
|
24
|
-
Requires-Dist: prompt-toolkit>=3.0
|
|
25
|
-
Requires-Dist: rich>=13.7
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
|
|
28
|
-
# meshapi-code
|
|
29
|
-
|
|
30
|
-
Terminal chat for [Mesh API](https://meshapi.ai) — the OpenAI-compatible LLM gateway. Streaming responses, live markdown, slash commands, real-time cost.
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
$ meshapi
|
|
34
|
-
╭───────────────────────────────╮
|
|
35
|
-
│ meshapi 0.1.0 │
|
|
36
|
-
│ model: anthropic/claude-… │
|
|
37
|
-
│ route: default │
|
|
38
|
-
╰───────────────────────────────╯
|
|
39
|
-
you > how do I parse SSE in python
|
|
40
|
-
… streamed markdown reply …
|
|
41
|
-
142 → 318 tok • $0.001234 • session $0.001234
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Install
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
pipx install meshapi-code # recommended
|
|
48
|
-
uv tool install meshapi-code # if you use uv
|
|
49
|
-
pip install meshapi-code # plain pip
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
The PyPI package is `meshapi-code`; the command on your `$PATH` is `meshapi`.
|
|
53
|
-
|
|
54
|
-
Then:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
export MESHAPI_API_KEY=rsk_your_key_here
|
|
58
|
-
meshapi
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Get a key at [meshapi.ai](https://meshapi.ai).
|
|
62
|
-
|
|
63
|
-
## What it does
|
|
64
|
-
|
|
65
|
-
- **Streaming completions** with live markdown rendering (`rich`)
|
|
66
|
-
- **Real cost per turn** — Mesh API returns `cost` in the SSE tail; we show it
|
|
67
|
-
- **Slash commands** — `/model`, `/route`, `/file`, `/system`, `/cost`, `/clear`
|
|
68
|
-
- **Mid-session model switching** — `/model openai/gpt-4o-mini`
|
|
69
|
-
- **Smart routing** — `/route cheapest` lets the gateway pick (Mesh-specific)
|
|
70
|
-
- **Persistent input history** — up-arrow recalls past prompts
|
|
71
|
-
- **Config + env-var override** — `~/.meshapi/config.json`, `MESHAPI_API_KEY`
|
|
72
|
-
|
|
73
|
-
## Slash commands
|
|
74
|
-
|
|
75
|
-
| Command | What it does |
|
|
76
|
-
|---|---|
|
|
77
|
-
| `/help` | List commands |
|
|
78
|
-
| `/model <name>` | Switch model (e.g. `anthropic/claude-sonnet-4.5`) |
|
|
79
|
-
| `/route <mode>` | `cheapest`, `fastest`, `balanced`, or `default` |
|
|
80
|
-
| `/file <path>` | Inject a file into the conversation |
|
|
81
|
-
| `/system <text>` | Replace system prompt and reset chat |
|
|
82
|
-
| `/cost` | Show cumulative session spend |
|
|
83
|
-
| `/clear` | Reset conversation |
|
|
84
|
-
| `/exit` | Quit |
|
|
85
|
-
|
|
86
|
-
## Config
|
|
87
|
-
|
|
88
|
-
`~/.meshapi/config.json`:
|
|
89
|
-
|
|
90
|
-
```json
|
|
91
|
-
{
|
|
92
|
-
"base_url": "https://api.meshapi.ai/v1",
|
|
93
|
-
"model": "anthropic/claude-sonnet-4.5",
|
|
94
|
-
"system": "You are a helpful coding assistant. Be concise.",
|
|
95
|
-
"route": null
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The API key is read from `MESHAPI_API_KEY` (preferred) or stored in the same file.
|
|
100
|
-
|
|
101
|
-
## Why it exists
|
|
102
|
-
|
|
103
|
-
Mesh API is OpenAI-compatible, so any generic chat CLI works against it. `meshapi` adds two things a generic CLI can't: (1) the gateway-only `cost` field shown after every turn, and (2) routing controls (`/route cheapest`) that hit Mesh's gateway-side model selection.
|
|
104
|
-
|
|
105
|
-
## Roadmap
|
|
106
|
-
|
|
107
|
-
- v0.2 — tool calling, repo-aware mode, diff apply, `npm i -g meshapi-code`
|
|
108
|
-
- v0.3 — Homebrew tap, curl|sh installer at `meshapi.ai/install.sh`
|
|
109
|
-
|
|
110
|
-
## License
|
|
111
|
-
|
|
112
|
-
MIT
|
meshapi_code-0.3.0/README.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# meshapi-code
|
|
2
|
-
|
|
3
|
-
Terminal chat for [Mesh API](https://meshapi.ai) — the OpenAI-compatible LLM gateway. Streaming responses, live markdown, slash commands, real-time cost.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
$ meshapi
|
|
7
|
-
╭───────────────────────────────╮
|
|
8
|
-
│ meshapi 0.1.0 │
|
|
9
|
-
│ model: anthropic/claude-… │
|
|
10
|
-
│ route: default │
|
|
11
|
-
╰───────────────────────────────╯
|
|
12
|
-
you > how do I parse SSE in python
|
|
13
|
-
… streamed markdown reply …
|
|
14
|
-
142 → 318 tok • $0.001234 • session $0.001234
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Install
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pipx install meshapi-code # recommended
|
|
21
|
-
uv tool install meshapi-code # if you use uv
|
|
22
|
-
pip install meshapi-code # plain pip
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The PyPI package is `meshapi-code`; the command on your `$PATH` is `meshapi`.
|
|
26
|
-
|
|
27
|
-
Then:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
export MESHAPI_API_KEY=rsk_your_key_here
|
|
31
|
-
meshapi
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Get a key at [meshapi.ai](https://meshapi.ai).
|
|
35
|
-
|
|
36
|
-
## What it does
|
|
37
|
-
|
|
38
|
-
- **Streaming completions** with live markdown rendering (`rich`)
|
|
39
|
-
- **Real cost per turn** — Mesh API returns `cost` in the SSE tail; we show it
|
|
40
|
-
- **Slash commands** — `/model`, `/route`, `/file`, `/system`, `/cost`, `/clear`
|
|
41
|
-
- **Mid-session model switching** — `/model openai/gpt-4o-mini`
|
|
42
|
-
- **Smart routing** — `/route cheapest` lets the gateway pick (Mesh-specific)
|
|
43
|
-
- **Persistent input history** — up-arrow recalls past prompts
|
|
44
|
-
- **Config + env-var override** — `~/.meshapi/config.json`, `MESHAPI_API_KEY`
|
|
45
|
-
|
|
46
|
-
## Slash commands
|
|
47
|
-
|
|
48
|
-
| Command | What it does |
|
|
49
|
-
|---|---|
|
|
50
|
-
| `/help` | List commands |
|
|
51
|
-
| `/model <name>` | Switch model (e.g. `anthropic/claude-sonnet-4.5`) |
|
|
52
|
-
| `/route <mode>` | `cheapest`, `fastest`, `balanced`, or `default` |
|
|
53
|
-
| `/file <path>` | Inject a file into the conversation |
|
|
54
|
-
| `/system <text>` | Replace system prompt and reset chat |
|
|
55
|
-
| `/cost` | Show cumulative session spend |
|
|
56
|
-
| `/clear` | Reset conversation |
|
|
57
|
-
| `/exit` | Quit |
|
|
58
|
-
|
|
59
|
-
## Config
|
|
60
|
-
|
|
61
|
-
`~/.meshapi/config.json`:
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"base_url": "https://api.meshapi.ai/v1",
|
|
66
|
-
"model": "anthropic/claude-sonnet-4.5",
|
|
67
|
-
"system": "You are a helpful coding assistant. Be concise.",
|
|
68
|
-
"route": null
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The API key is read from `MESHAPI_API_KEY` (preferred) or stored in the same file.
|
|
73
|
-
|
|
74
|
-
## Why it exists
|
|
75
|
-
|
|
76
|
-
Mesh API is OpenAI-compatible, so any generic chat CLI works against it. `meshapi` adds two things a generic CLI can't: (1) the gateway-only `cost` field shown after every turn, and (2) routing controls (`/route cheapest`) that hit Mesh's gateway-side model selection.
|
|
77
|
-
|
|
78
|
-
## Roadmap
|
|
79
|
-
|
|
80
|
-
- v0.2 — tool calling, repo-aware mode, diff apply, `npm i -g meshapi-code`
|
|
81
|
-
- v0.3 — Homebrew tap, curl|sh installer at `meshapi.ai/install.sh`
|
|
82
|
-
|
|
83
|
-
## License
|
|
84
|
-
|
|
85
|
-
MIT
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|