tapeo-cli 0.0.0-stage → 0.4.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 +11 -0
- package/README.md +157 -2
- package/cli/tapeo.mjs +509 -0
- package/package.json +33 -4
- package/shared/api.mjs +238 -0
- package/shared/fpga.mjs +72 -0
- package/shared/problems.mjs +82 -0
- package/shared/proposals.mjs +112 -0
- package/shared/serial.mjs +77 -0
- package/shared/stream.mjs +62 -0
- package/shared/sync.mjs +287 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Copyright (c) 2026 Tapeo (https://tapeo.net). All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software is proprietary. You may install and use it to work with Tapeo
|
|
4
|
+
services. You may not copy, modify, redistribute, sublicense, or create
|
|
5
|
+
derivative works of it, except as permitted by law, without written permission.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
8
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
9
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
10
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING
|
|
11
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,158 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://tapeo.net/icons/icon-512.png" alt="Tapeo" width="96" height="96">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Tapeo for your terminal and VS Code</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">Design, run, and fix chips from your own shell or editor, on the same projects as <a href="https://tapeo.net">tapeo.net</a>.</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/tapeo-cli"><img src="https://img.shields.io/npm/v/tapeo-cli?label=tapeo-cli&logo=npm&color=cb3837" alt="tapeo-cli on npm"></a>
|
|
11
|
+
<a href="https://marketplace.visualstudio.com/items?itemName=tapeo.tapeo-vscode"><img src="https://img.shields.io/badge/VS%20Code%20Marketplace-Tapeo-0078d4?logo=visualstudiocode&logoColor=white" alt="Tapeo for VS Code"></a>
|
|
12
|
+
<img src="https://img.shields.io/node/v/tapeo-cli?logo=nodedotjs&logoColor=white&color=5fa04e" alt="Node.js version">
|
|
13
|
+
<a href="https://tapeo.net/docs#local-clients"><img src="https://img.shields.io/badge/docs-tapeo.net-e8914a" alt="Documentation"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g tapeo-cli
|
|
20
|
+
tapeo login # approve this device in your browser
|
|
21
|
+
tapeo new "A 4-bit counter with enable" ./counter # design, build, and pull the files
|
|
22
|
+
cd counter && tapeo show # stage results of that build
|
|
23
|
+
# edit rtl/…, then: tapeo push --all && tapeo run --watch
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
In VS Code, install **Tapeo** from the Extensions view and run **Tapeo: Connect to Server**.
|
|
27
|
+
|
|
28
|
+
| Feature | What you get |
|
|
29
|
+
|---|---|
|
|
30
|
+
| 🧭 **Design with the Architect** | `tapeo new` asks clarifying questions, proposes design options, shows the build plan, and builds. |
|
|
31
|
+
| 🔁 **Edit → run → results** | Push your files, run the full flow or one stage, and read stage results, tool logs, and goals. |
|
|
32
|
+
| 🎯 **Errors on the right line** | `tapeo problems`, or the VS Code Problems panel, points at the line a tool complained about. |
|
|
33
|
+
| 🛠️ **AI Engineer** | `tapeo ask` streams an answer; review the proposed diff and `tapeo apply` it locally. |
|
|
34
|
+
| 🔒 **Safe sync** | Every push names the version it was based on; your local edits are never overwritten. |
|
|
35
|
+
|
|
36
|
+
## About
|
|
37
|
+
|
|
38
|
+
A terminal client and a VS Code extension for the same Tapeo projects as the web app. They call the same server, file storage, workflow queue, and plan allowances as the browser, through the token-authenticated API under `/api/client/v1`. Version 0.4.0 was published on 2026-10-24 (`tapeo-cli` on npm and **Tapeo**, `tapeo.tapeo-vscode`, on the VS Code Marketplace). They are early releases (0.x).
|
|
39
|
+
|
|
40
|
+
The edit → run → results loop works without the browser: push your files, start a run, follow it stage by stage, and read stage results, tool logs, and goal results. You can also start a new design with the Architect, ask the AI Engineer and apply its proposed changes locally, and see tool errors on the lines they name. The 2D/3D layout views, Evaluation-plan review, and Architect image/PDF attachments stay in the web workspace.
|
|
41
|
+
|
|
42
|
+
Self-hosted servers need migrations `0008_client_tokens` and `0009_device_authorization` (`npx prisma migrate deploy`; the Docker deployment applies them on start). Maintainers: releasing is described in `docs/RELEASING.md` in the Tapeo repository.
|
|
43
|
+
|
|
44
|
+
## Sign in
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm install -g tapeo-cli # from source: npm install -g ./clients, or npm run tapeo -- <command>
|
|
48
|
+
tapeo login # https://tapeo.net; or: tapeo login https://your-own-server
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`tapeo login` opens `/device?code=ABCD-EFGH` in your browser. Check that the code matches, approve the device, and the terminal finishes signing in. Only a digest of the device code is stored, and no token exists until you approve. The device gets its own token: it expires after 90 days, appears on **Account → VS Code and terminal access**, and can be revoked there. Without a browser, create a token on that page and use `tapeo login <url> --token` (hidden prompt). The sign-in is saved in `~/.config/tapeo/client.json` (mode 0600); `tapeo logout` removes it. `TAPEO_URL` and `TAPEO_TOKEN` override it for automation. `TAPEO_NO_BROWSER=1` makes `tapeo login` only print the approval address instead of opening a browser. Remote servers must use HTTPS; HTTP is accepted for localhost only.
|
|
52
|
+
|
|
53
|
+
## Terminal
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
tapeo projects # your projects
|
|
57
|
+
tapeo create "My sensor" ./my-sensor # new empty project, bound to the folder
|
|
58
|
+
tapeo pull PROJECT_ID ./existing # or bind an existing project
|
|
59
|
+
tapeo delete PROJECT_ID # delete a project on the server for good (asks for its name)
|
|
60
|
+
cd ./my-sensor
|
|
61
|
+
tapeo status # what changed locally, and the latest run
|
|
62
|
+
tapeo push --all # push every modified and new source file
|
|
63
|
+
tapeo run --watch # full run; follow it, then show results and goals
|
|
64
|
+
tapeo run --stage drc # rerun one stage on the saved files
|
|
65
|
+
tapeo run --from synthesis # rerun a stage and every later one
|
|
66
|
+
tapeo runs # recent runs and their status
|
|
67
|
+
tapeo watch # follow the latest run until it ends, then show results
|
|
68
|
+
tapeo show # stage results, AI changes, tool runs of the latest run
|
|
69
|
+
tapeo logs TOOL_RUN_ID # a tool run's saved output (ids from tapeo show)
|
|
70
|
+
tapeo goals # the latest goal report
|
|
71
|
+
tapeo cancel # cancel the active run
|
|
72
|
+
tapeo pull --outputs # also download tool outputs (read-only)
|
|
73
|
+
tapeo download generated/layout/top.openroad.gds
|
|
74
|
+
tapeo rm rtl/old.sv # delete on the server and locally
|
|
75
|
+
tapeo mv rtl/a.sv rtl/core/a.sv # rename
|
|
76
|
+
tapeo open # the project's web address
|
|
77
|
+
tapeo --version # this client's version (tapeo help lists every command)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`tapeo delete` removes a project on the server for good, like the delete button in the browser's project list: its files, checkpoints, runs, layouts, and Engineer history (a running workflow stops). In a linked folder it deletes that folder's project unless you name another. You confirm by typing the project name (`--yes` skips this, for scripts). Local files stay, and the folder is no longer linked.
|
|
81
|
+
|
|
82
|
+
### AI
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
tapeo new "A sensor that warns when a tank is full" ./tank # design with the Architect, then build
|
|
86
|
+
tapeo new "Wrap my FIFO" . --from-files # start from the RTL in this folder
|
|
87
|
+
tapeo ask "Why does the counter not wrap at 15?" # ask the Engineer (answer streams)
|
|
88
|
+
tapeo proposals # its proposed changes, as diffs
|
|
89
|
+
tapeo apply # apply all of them to local files (or: tapeo apply 1 3)
|
|
90
|
+
tapeo push --all # then save them in Tapeo
|
|
91
|
+
tapeo discard # or forget them
|
|
92
|
+
tapeo history # the Engineer conversation, shared with the browser (--limit N, default 10)
|
|
93
|
+
tapeo problems # tool errors and warnings of the latest run, as file:line:col
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`tapeo new` asks the Architect's clarifying questions and lets you pick an option when run in a terminal. For scripts, `--auto-answers` answers "Not sure — you choose", `--option N` picks a design, `--yes` confirms the build (one build from your plan), and `--no-build` creates the project without building. After the build, the generated files are pulled into the folder. The Architect conversation is not saved on the server; the project keeps the chosen requirements and design.
|
|
97
|
+
|
|
98
|
+
The Engineer reads the saved server copy of your files (`tapeo ask` warns when local edits are not pushed). Its proposed changes are kept in `.tapeo/proposals.json` until you apply or discard them, and a new answer with changes replaces them. Applying follows the browser's rules: a new file must not exist yet, and the code being replaced must occur exactly once. A change that no longer fits is marked failed with the reason and can be retried after you fix the file. Changes to tool outputs (`generated/`, `signoff/`) or paths outside the project are refused. Deleting a file applies locally; `tapeo rm` deletes it on the server. If the Engineer also proposed an evaluation plan, review it in the web workspace.
|
|
99
|
+
|
|
100
|
+
`tapeo problems [run-id]` reads the run's tool logs and lists file-level errors from every tool run, plus warnings from tool runs that failed. It recognizes Verilator, Icarus Verilog, Yosys, and Tcl script locations and matches log paths to project files by their ending. Messages without a project file and line stay in `tapeo logs`.
|
|
101
|
+
|
|
102
|
+
Stages: `simulation`, `synthesis`, `timing`, `physical`, `post-route-timing`, `drc`, `extraction`, `erc`, `lvs`. `--no-ai-repairs` turns off AI repairs for a stage run. A full run uses one build from your plan; a stage run does not. `tapeo run --watch` exits with code 3 when the run fails.
|
|
103
|
+
|
|
104
|
+
### FPGA boards
|
|
105
|
+
|
|
106
|
+
For a project whose target is an FPGA board, or an FPGA board and a chip (the Architect asks where a design runs; you can change it on the Workflow tab), the workflow simulates the RTL, then builds and checks a bitstream for the board on the server. Supported boards: Sipeed Tang Nano 9K and Tang Nano 20K, 1BitSquared iCEBreaker, and Radiona ULX3S (12F and 85F). A design clock other than the board clock gets a PLL generated by the toolchain's own calculator.
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
tapeo run --watch # simulate, build the bitstream, report logic use and Fmax
|
|
110
|
+
tapeo flash # download the bitstream and program the connected board
|
|
111
|
+
tapeo flash --flash # keep it after power-off (Tang Nano and ULX3S otherwise load to SRAM)
|
|
112
|
+
tapeo flash --board icebreaker # when bitstreams exist for several boards
|
|
113
|
+
tapeo monitor # the board's serial (UART) output; type a line to send it
|
|
114
|
+
tapeo monitor --port /dev/cu.usbserial-1101 --baud 9600
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`tapeo flash` runs the open-source `openFPGALoader` on your computer and tells you how to install it if it is missing (`brew install openfpgaloader` on macOS, `sudo apt install openfpgaloader` on Debian/Ubuntu, or OSS CAD Suite elsewhere). `TAPEO_OPENFPGALOADER` points to it when it is not on your PATH. The bitstream is saved read-only under `generated/fpga/<board>/`.
|
|
118
|
+
|
|
119
|
+
`tapeo monitor` needs no sign-in and works on macOS and Linux: it finds the USB serial port (name one with `--port` when there are several; a Tang Nano shows two and its serial link is usually the second) and uses 115200 baud unless you pass `--baud`. On Linux you may need to be in the `dialout` group. On Windows, use the **Serial monitor** on the project's Workflow tab in Chrome or Edge.
|
|
120
|
+
|
|
121
|
+
## VS Code
|
|
122
|
+
|
|
123
|
+
Run `npm run build:vscode`, open `clients/vscode` in VS Code, and press F5; or run `npm run package:vscode` and install `clients/vscode/tapeo-vscode.vsix` with **Extensions: Install from VSIX...**. In the Command Palette:
|
|
124
|
+
|
|
125
|
+
- **Tapeo: Connect to Server**: sign in with your browser (recommended) or paste a token. The token is kept in VS Code SecretStorage. **Tapeo: Sign Out** removes it.
|
|
126
|
+
- **Create Project** / **Pull Project Files** bind the open folder; **Pull Tool Outputs (read-only)** adds tool outputs.
|
|
127
|
+
- **Show Local Changes**, **Push Current File**, **Push All Changes**, **Delete Current File on the Server**.
|
|
128
|
+
- **Run Workflow** (full run, one stage, or from a stage). The status bar follows the run; when it ends, a notification offers the details, the goals, or the project in the browser.
|
|
129
|
+
- **Show Workflow Runs**, **Show Run Details**, **Open a Tool Log**, **Show Goal Results**, **Cancel Workflow**, **Open Project in Browser**.
|
|
130
|
+
- **New Design with the Architect** (in an empty folder): the Architect's questions appear as quick picks with "Not sure — you choose", then the design options and the build plan; **Build** creates the project, starts the first build, and pulls the generated files when it ends.
|
|
131
|
+
- **Open AI Engineer** opens the **Tapeo Engineer** panel beside the editor: the project conversation, streamed answers, and the proposed changes with **Review** (a side-by-side diff), **Apply**, **Apply all**, and **Discard**. **Ask the AI Engineer**, **Review Proposed Changes**, **Apply All Proposed Changes**, and **Discard Proposed Changes** do the same from the Command Palette. Applying is refused while the file has unsaved edits; push afterwards.
|
|
132
|
+
- **Program FPGA Board** (FPGA projects): downloads the bitstream and programs the connected board with `openFPGALoader` in a **Tapeo FPGA** terminal.
|
|
133
|
+
- **Open Serial Monitor** (macOS and Linux): shows the board's serial output in a terminal and sends the lines you type.
|
|
134
|
+
- **Show Tool Problems**: the latest run's tool errors and warnings in the Problems panel. This also happens automatically when a run the status bar follows ends, and starting a run clears them.
|
|
135
|
+
|
|
136
|
+
The setting `tapeo.serverUrl` holds the server (Connect to Server sets it; remote servers must use HTTPS).
|
|
137
|
+
|
|
138
|
+
In a bound folder, the status bar shows the latest run when VS Code starts and follows it if it is still running.
|
|
139
|
+
|
|
140
|
+
## How files are kept safe
|
|
141
|
+
|
|
142
|
+
- `.tapeo/state.json` records the project id, the server, and the SHA-256 of each file as last pulled or pushed. It holds no token and is ignored by Git.
|
|
143
|
+
- Pull skips `generated/`, `signoff/`, and files over 2 MB, never overwrites a local edit, and reports conflicts. When both sides changed, the server copy is saved under `.tapeo/conflicts/` for comparison.
|
|
144
|
+
- Push (one file or `--all`) sends each file with the hash it was based on. If the server copy changed meanwhile, that file is refused (HTTP 409), the local edit is kept, and the server copy is saved under `.tapeo/conflicts/`; other files still push. New files are found by source extension (`.sv`, `.v`, `.vhd`, `.sdc`, `.tcl`, `.hex`, `.mem`, `.c`, `.h`, `.S`, `.ld`, and similar) outside `generated/`, `signoff/`, hidden folders, and build folders.
|
|
145
|
+
- Deleting a file locally does not delete it on the server; `tapeo rm` does, and only the version last pulled.
|
|
146
|
+
- Tool outputs (`generated/`, `signoff/`) are read-only: they download with mode 0444 and are never pushed. Outputs over 25 MB (a layout) are listed for `tapeo download`.
|
|
147
|
+
- An expired or revoked sign-in asks you to sign in again; an unreachable server reports a network error or timeout. A run is refused before using a build when no workflow worker is connected. None of these change local files.
|
|
148
|
+
|
|
149
|
+
## Workflow runs
|
|
150
|
+
|
|
151
|
+
A run from a local client executes the saved files, including edits just pushed; it never regenerates HDL. It uses the same queue, checkpoints, plan limits, and usage accounting as the browser (`lib/workflow-runs.ts`). Cancelling stops a run before its next stage; a tool step already running finishes first, and finished stages keep their results. A full run still counts as the build it started as.
|
|
152
|
+
|
|
153
|
+
## Tests
|
|
154
|
+
|
|
155
|
+
- `tests/client-ai.test.ts`: streamed answers, clarification wording, problem extraction for each tool's format, proposals (apply rules, retry, refusals, discard), design-file limits, the client API, and the real `tapeo` command for `ask`/`proposals`/`apply`/`history`/`problems`/`discard` and `new` (questions, option, plan, build, follow, pull, bound-folder refusal).
|
|
156
|
+
- `npm test` includes `tests/client-workflow.test.ts` (shared client: sign-in, watching, status, push-all, rm/mv, outputs, formatting), `tests/client-sync.test.ts`, and `tests/client-cli.test.ts` (the real `tapeo` command against a fake server, from sign-in to cancel).
|
|
157
|
+
- `npm run test:e2e` checks the server side against a real database: browser device approval, run details, tool logs, goals, cancel (client and browser), raw download, delete with its conflict check, the Engineer and Architect routes' sign-in, validation, and ownership checks, the build plan, and creating a project from a design (with "build" refused, and no run recorded, when no worker is connected). It does not call the AI.
|
|
158
|
+
- `npm run test:vscode` drives a real VS Code Extension Development Host through connect, create, a new design with the Architect (and its refusal in a bound folder), pull, push, push all, run, tool problems in the Problems panel, run details, goals, the Engineer (ask, review diff, apply refused for an unsaved file, apply, push), and conflict, worker, and sign-in failures, against a local fixture server. `TAPEO_VSCODE_VSIX="$PWD/clients/vscode/tapeo-vscode.vsix" npm run test:vscode` repeats it with the packaged extension. VS Code must be installed; `TAPEO_VSCODE_BIN` selects another `code` executable.
|