CLI for cist kernel telemetry and compilation
Project description
CIST Monorepo
Polyglot monorepo for the Contract Instruction Set (.cis) language.
This repository ships three user-facing pieces together:
cist-kernelPython package — the CLI, the syntax validator, and the cloud compiler client.- A VS Code extension bundled inside the package — installed automatically by
cist init. - A build orchestrator (
scripts/build.py) for cutting releases.
Language Snapshot
use math
use compute
use risk
market_data := from data (source: "binance", symbols: ["BTC-USD"], resolution: "1m")
sma_20 := math.sma(market_data.close, 20)
signal := compute.crossover(market_data.price, sma_20)
if signal and position.size == 0:
execute(market_buy(size: risk.calculate_size(portfolio_value: 10000)))
elif position.pnl < -100:
execute(close_position())
Repository Layout
cist/
├── pyproject.toml
├── README.md
├── .env.example
├── scripts/
│ └── build.py
├── cist_cli/
│ ├── __init__.py
│ ├── main.py
│ ├── parser.py
│ ├── network.py
│ └── assets/
│ └── .gitkeep
├── tests/
│ └── test_parser.py
└── vscode-extension/
├── README.md
├── package.json
├── language-configuration.json
└── syntaxes/
└── cis.tmLanguage.json
Getting Started
pip install cist-kernel
python -m cist_cli
Works on Windows, macOS, and Linux immediately after install — no PATH setup, no extra tools. Running python -m cist_cli with no arguments automatically runs init.
After init runs, if cist isn't yet on your PATH it will print the exact one-liner to fix it permanently. Once you've done that (and reopened your terminal), you can use the short form for everything:
cist compile contracts/my_strategy.cis
init creates a workspace, writes a .env config file, and — if VS Code is detected — installs the .cis syntax extension automatically. Open contracts/example.cis and start writing.
Add --deploy to mark a build as live:
cist compile contracts/my_strategy.cis --deploy
How To Use CIST
pip install cist-kernel— one-time install.python -m cist_cli— first run (works before PATH is configured). No args = auto-runsinit. After this, usecist init/cist compiledirectly.- Add your
CIST_CLOUD_API_KEYto the generated.env. - Write
.cisfiles incontracts/. cist compile <file.cis>— validates syntax locally, then streams compilation output from the cloud.
Example contract:
use math
use compute
use risk
market_data := from data (source: "binance", symbols: ["BTC-USD"], resolution: "1m")
sma_20 := math.sma(market_data.close, 20)
signal := compute.crossover(market_data.price, sma_20)
if signal and position.size == 0:
execute(market_buy(size: risk.calculate_size(portfolio_value: 10000)))
elif position.pnl < -100:
execute(close_position())
CLI Reference
cist init [--path <dir>]
- Creates
contracts/andexample.cis. - Writes a
.envstub withCIST_CLOUD_API_KEYplaceholder. - Detects VS Code and installs the bundled
.cisextension automatically.
cist compile <file.cis> [--deploy] [--verbose]
- Validates syntax locally first (bracket matching,
useimports,from dataexpressions, encoding). - Streams compilation logs, artifacts, and errors from the cloud compiler.
--deployflags the build as ready for live execution.--verboseprints detected modules and data stream count.
Configuration
The CLI reads environment variables directly and also loads them from .env if present.
Required for cloud compilation:
CIST_CLOUD_API_KEY=sk_live_your_api_key_here
Optional override:
CIST_CLOUD_ENDPOINT=https://api.cist.io/v1
Build Artifacts
Build both deliverables with:
python scripts/build.py
Expected outputs:
dist/cist-*.whlcist_cli/assets/cist-*.vsix
Notes
- Local validation is lightweight and non-executing. It checks UTF-8 decoding, bracket matching, quote closure,
usestatements,from data (...)expressions, and mixed tab/space indentation. - Cloud compilation requires
CIST_CLOUD_API_KEY. The CLI also reads.envautomatically if present. - The VS Code grammar uses Python-style scope categories while adding CIST-specific handling for
useandfrom data.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cist_kernel-0.0.3-py3-none-any.whl.
File metadata
- Download URL: cist_kernel-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbe834f869050b441e7f32d6e9b1c8eef8688edd333c8b31e1e1f9a922c18f06
|
|
| MD5 |
481a7acf845405bef7f826c0a0edf69a
|
|
| BLAKE2b-256 |
b5816117ac93029c29c4923c0baa031c00b351a7114d32387c3ae6b5e0d5b0d7
|