@byteask/cli 0.1.1
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/README.md +130 -0
- package/bin/byteask.js +62 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ByteAsk
|
|
2
|
+
|
|
3
|
+
**An AI coding agent for your terminal.** Like Claude Code or Codex, `byteask` drops
|
|
4
|
+
a capable agent into your shell — an interactive TUI, real tool use, and first-class
|
|
5
|
+
C/C++ tooling — talking to the self-hosted ByteAsk gateway.
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/byteask/)
|
|
8
|
+
[](https://www.npmjs.com/package/@byteask/cli)
|
|
9
|
+
[](https://pypi.org/project/byteask/)
|
|
10
|
+
[](https://code.byteask.ai)
|
|
11
|
+
|
|
12
|
+
```console
|
|
13
|
+
$ byteask
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
That's it — one command drops you into an interactive session, the same way `claude`
|
|
17
|
+
or `codex` do. First run signs you in; after that, just type.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
Pick whichever fits your setup — they all install the same native engine and share one
|
|
24
|
+
runtime, so switching between them is free.
|
|
25
|
+
|
|
26
|
+
**pip**
|
|
27
|
+
```bash
|
|
28
|
+
pip install byteask
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**npm**
|
|
32
|
+
```bash
|
|
33
|
+
npm install -g @byteask/cli
|
|
34
|
+
# or, no install:
|
|
35
|
+
npx @byteask/cli
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Shell (Linux / macOS)**
|
|
39
|
+
```bash
|
|
40
|
+
curl -fsSL https://code.byteask.ai/install.sh | sh
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**PowerShell (Windows)**
|
|
44
|
+
```powershell
|
|
45
|
+
irm https://code.byteask.ai/install.ps1 | iex
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `pip` and `npm` packages are thin launchers: on first run they fetch the native
|
|
49
|
+
engine into `~/.byteask/runtime` and hand off to it. Nothing else on your machine
|
|
50
|
+
changes.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Quickstart
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# 1. Sign in (magic link to your email) — or just run `byteask`, it onboards you.
|
|
58
|
+
byteask login --email you@company.com
|
|
59
|
+
|
|
60
|
+
# 2. Start coding, interactively:
|
|
61
|
+
byteask
|
|
62
|
+
|
|
63
|
+
# 3. Or one-shot a question against the current repo:
|
|
64
|
+
byteask "explain what this service does and where the entrypoint is"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Inside the session, type your task in plain English. The agent reads files, runs
|
|
68
|
+
tools, and proposes edits — you stay in control of what it applies.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Commands
|
|
73
|
+
|
|
74
|
+
| Command | What it does |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| `byteask` | Open the interactive agent (the default) |
|
|
77
|
+
| `byteask "…"` | Run a one-shot prompt against the current directory |
|
|
78
|
+
| `byteask login` | Sign in (magic link → token) |
|
|
79
|
+
| `byteask logout` | Sign out on this machine |
|
|
80
|
+
| `byteask --update` | Update to the latest engine |
|
|
81
|
+
| `byteask --version` | Print the version |
|
|
82
|
+
|
|
83
|
+
Inside the TUI, slash commands include **`/login`**, **`/logout`**, **`/usage`** (your
|
|
84
|
+
quota), **`/upgrade`** (Pro / Max), **`/referral-code`**, and **`/status`**.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## What you get
|
|
89
|
+
|
|
90
|
+
- **Interactive TUI** — a real terminal agent, not a chat box: it navigates the repo,
|
|
91
|
+
runs commands, and shows diffs before applying.
|
|
92
|
+
- **First-class C/C++ tooling** — 16 native tools wired in: Compiler Explorer
|
|
93
|
+
(godbolt), `gdb`/`lldb`, ASan/UBSan/valgrind, `clang-tidy`, `clang-format`, `clangd`
|
|
94
|
+
navigation, `perf`/callgrind, quick-bench, cppinsights, objdump/nm/readelf, Intel
|
|
95
|
+
intrinsics lookup, and more. The agent reaches for them on the tasks that need them.
|
|
96
|
+
- **Web search** built in.
|
|
97
|
+
- **Zero data retention** — your prompts and code are not used to train models.
|
|
98
|
+
- **Usage that's visible** — `/usage` shows exactly where you stand; upgrade in-app
|
|
99
|
+
with `/upgrade`.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Platforms
|
|
104
|
+
|
|
105
|
+
| OS | Architecture | libc |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| Linux | x86_64, arm64 | glibc |
|
|
108
|
+
| macOS | Apple Silicon (arm64) | — |
|
|
109
|
+
| Windows | x86_64 | — |
|
|
110
|
+
|
|
111
|
+
> Alpine / musl isn't supported (a core dependency ships no musl build). On Alpine,
|
|
112
|
+
> use WSL or a glibc base image.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## How it works
|
|
117
|
+
|
|
118
|
+
`byteask` is a thin client. The intelligence and your account live behind the ByteAsk
|
|
119
|
+
gateway; the local binary is the agent runtime plus a small launcher that handles
|
|
120
|
+
sign-in, updates, and your config in `~/.byteask`. Your model key never touches your
|
|
121
|
+
machine.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Links
|
|
126
|
+
|
|
127
|
+
- Home: <https://code.byteask.ai>
|
|
128
|
+
- Install script: <https://code.byteask.ai/install.sh>
|
|
129
|
+
|
|
130
|
+
MIT licensed.
|
package/bin/byteask.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// ByteAsk npm launcher (thin bootstrapper).
|
|
4
|
+
//
|
|
5
|
+
// On first run it installs the native ByteAsk engine + wrapper into a shared
|
|
6
|
+
// runtime dir (~/.byteask/runtime) via the same installer the curl|sh path uses,
|
|
7
|
+
// then execs the wrapper. All the real logic (login, onboarding, update check,
|
|
8
|
+
// /login|/logout loop) lives in that native wrapper — this file only bootstraps.
|
|
9
|
+
// The runtime dir is shared with the pip package, so the engine downloads once.
|
|
10
|
+
|
|
11
|
+
const { spawnSync } = require("child_process");
|
|
12
|
+
const { existsSync, mkdirSync } = require("fs");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const os = require("os");
|
|
15
|
+
|
|
16
|
+
const BUNDLE = (process.env.BYTEASK_BUNDLE_URL || "https://code.byteask.ai").replace(/\/+$/, "");
|
|
17
|
+
const HOME = process.env.BYTEASK_HOME || path.join(os.homedir(), ".byteask");
|
|
18
|
+
const VENDOR = path.join(HOME, "runtime");
|
|
19
|
+
const isWin = process.platform === "win32";
|
|
20
|
+
const wrapper = path.join(VENDOR, isWin ? "byteask.ps1" : "byteask");
|
|
21
|
+
const engine = path.join(VENDOR, isWin ? "byteask-engine.exe" : "byteask-engine");
|
|
22
|
+
|
|
23
|
+
function run(cmd, args) {
|
|
24
|
+
return spawnSync(cmd, args, { stdio: "inherit" });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function ensureInstalled() {
|
|
28
|
+
if (existsSync(engine) && existsSync(wrapper)) return;
|
|
29
|
+
mkdirSync(VENDOR, { recursive: true });
|
|
30
|
+
process.stderr.write("[byteask] first run: fetching the ByteAsk engine (one time)...\n");
|
|
31
|
+
let r;
|
|
32
|
+
if (isWin) {
|
|
33
|
+
const ps =
|
|
34
|
+
"$ErrorActionPreference='Stop'; $env:PREFIX=" +
|
|
35
|
+
JSON.stringify(VENDOR) +
|
|
36
|
+
"; iex (irm " +
|
|
37
|
+
JSON.stringify(BUNDLE + "/install.ps1") +
|
|
38
|
+
")";
|
|
39
|
+
r = run("powershell", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps]);
|
|
40
|
+
} else {
|
|
41
|
+
const sh =
|
|
42
|
+
"curl -fsSL " +
|
|
43
|
+
JSON.stringify(BUNDLE + "/install.sh") +
|
|
44
|
+
" | PREFIX=" +
|
|
45
|
+
JSON.stringify(VENDOR) +
|
|
46
|
+
" sh";
|
|
47
|
+
r = run("sh", ["-c", sh]);
|
|
48
|
+
}
|
|
49
|
+
if (!r || r.status !== 0 || !existsSync(engine)) {
|
|
50
|
+
process.stderr.write(
|
|
51
|
+
"[byteask] install failed. Try the direct installer: curl -fsSL " + BUNDLE + "/install.sh | sh\n"
|
|
52
|
+
);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ensureInstalled();
|
|
58
|
+
const args = process.argv.slice(2);
|
|
59
|
+
const r = isWin
|
|
60
|
+
? run("powershell", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", wrapper].concat(args))
|
|
61
|
+
: run("sh", [wrapper].concat(args));
|
|
62
|
+
process.exit(r.status === null ? 1 : r.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@byteask/cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "ByteAsk - AI coding agent CLI for your terminal. Run `npx @byteask/cli` or `npm i -g @byteask/cli`.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"byteask": "bin/byteask.js"
|
|
7
|
+
},
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=16"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"byteask",
|
|
20
|
+
"ai",
|
|
21
|
+
"coding-agent",
|
|
22
|
+
"cli",
|
|
23
|
+
"tui"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"homepage": "https://code.byteask.ai",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/ByteAsk/byteask-gateway.git",
|
|
30
|
+
"directory": "byteask/dist/npm"
|
|
31
|
+
}
|
|
32
|
+
}
|