trickle-cli 0.1.221 → 0.1.222
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 +121 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# trickle-cli
|
|
2
|
+
|
|
3
|
+
Runtime type annotations for Python — see tensor shapes, variable types, and crash-time values as you code.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g trickle-cli
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
> trickle --help
|
|
11
|
+
Usage: trickle [options] [command]
|
|
12
|
+
|
|
13
|
+
Commands:
|
|
14
|
+
init [options] Set up trickle in your project
|
|
15
|
+
run [options] [command...] Run any command with universal type observation
|
|
16
|
+
vars [options] Show captured variable types and sample values
|
|
17
|
+
hints [options] [file] Output source code with inline type hints
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install trickle-observe # Python runtime tracer
|
|
24
|
+
npm install -g trickle-cli # this package
|
|
25
|
+
code --install-extension yiheinchai.trickle-vscode # VSCode inline hints
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
trickle run python train.py # run with tracing
|
|
30
|
+
trickle hints # view source with inline types
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Commands
|
|
34
|
+
|
|
35
|
+
### `trickle run`
|
|
36
|
+
|
|
37
|
+
Run any Python script with automatic variable tracing. Zero code changes needed.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
trickle run python train.py
|
|
41
|
+
trickle run python -m pytest tests/
|
|
42
|
+
trickle run python manage.py runserver
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
| Flag | Description |
|
|
46
|
+
|------|-------------|
|
|
47
|
+
| `--include <patterns>` | Only observe matching modules |
|
|
48
|
+
| `--exclude <patterns>` | Skip matching modules |
|
|
49
|
+
| `--stubs <dir>` | Auto-generate .pyi type stubs after run |
|
|
50
|
+
| `-w, --watch` | Watch and re-run on changes |
|
|
51
|
+
|
|
52
|
+
### `trickle hints`
|
|
53
|
+
|
|
54
|
+
Output source code with inline type annotations — designed for AI agents and terminal workflows.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
trickle hints train.py # types for a file
|
|
58
|
+
trickle hints --errors # crash-time values + error underline
|
|
59
|
+
trickle hints --errors --show types # types only
|
|
60
|
+
trickle hints --errors --show values # values only
|
|
61
|
+
trickle hints --errors --show both # both (default in error mode)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Example output:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
def forward(self, x: Tensor[128, 2] float32):
|
|
68
|
+
x: Tensor[128, 256] float32 = self.relu(self.bn0(self.embed(x)))
|
|
69
|
+
x: Tensor[128, 16, 16] float32 = x.view(x.size(0), 16, 16)
|
|
70
|
+
x: Tensor[128, 32, 16] float32 = self.relu(self.bn1(self.conv1(x)))
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Error mode:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
# train.py — ERROR
|
|
77
|
+
# ValueError: could not convert string to float: 'ID' (line 20)
|
|
78
|
+
# Variables at crash time:
|
|
79
|
+
file_path: string = "demographics.txt"
|
|
80
|
+
patient_gait_data: string[] = ["ID\tStudy\tGroup\t..."]
|
|
81
|
+
[float(d) for d in time.split('\t')] for time in patient_gait_data
|
|
82
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <- ValueError: could not convert string to float: 'ID'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### `trickle vars`
|
|
86
|
+
|
|
87
|
+
Table view of all captured variables.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
trickle vars # all variables
|
|
91
|
+
trickle vars --tensors # only tensors
|
|
92
|
+
trickle vars --file model.py # filter by file
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `trickle init`
|
|
96
|
+
|
|
97
|
+
Set up trickle in a project — configures tsconfig, package.json scripts, .gitignore.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
trickle init
|
|
101
|
+
trickle init --python
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## How It Works
|
|
105
|
+
|
|
106
|
+
Trickle rewrites your Python source via AST transformation before execution. After every variable assignment, it inserts a lightweight call that captures the type and a sample value, then writes to `.trickle/variables.jsonl`.
|
|
107
|
+
|
|
108
|
+
- Only your code is traced — stdlib, site-packages, torch/numpy internals are skipped
|
|
109
|
+
- No code changes. No decorators. No type annotations required
|
|
110
|
+
- The [VSCode extension](https://marketplace.visualstudio.com/items?itemName=yiheinchai.trickle-vscode) reads this file and renders inline hints
|
|
111
|
+
|
|
112
|
+
## Related Packages
|
|
113
|
+
|
|
114
|
+
| Package | Description |
|
|
115
|
+
|---------|-------------|
|
|
116
|
+
| [trickle-observe](https://pypi.org/project/trickle-observe/) | Python runtime tracer (`pip install trickle-observe`) |
|
|
117
|
+
| [trickle-vscode](https://marketplace.visualstudio.com/items?itemName=yiheinchai.trickle-vscode) | VSCode extension for inline type hints |
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trickle-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.222",
|
|
4
4
|
"description": "Zero-code runtime observability for JS/Python + AI agent debugging. Traces LangChain, CrewAI, OpenAI, Anthropic, Gemini. Eval, security, compliance, cost tracking. Free, local-first.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|