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:
cistPython CLI for workspace bootstrapping, local syntax validation, and cloud compilation.- A VS Code extension that adds
.cislanguage registration, indentation rules, and syntax highlighting. - A build orchestrator that packages the Python wheel and VSIX from one command.
What You Install
If you only want to write and validate .cis files locally, install the Python CLI.
If you want editor syntax highlighting for .cis, install the VS Code extension.
If you want to send contracts to the remote compiler, you need the CLI plus a CIST_CLOUD_API_KEY.
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
Installation
Install From Source
Use this when you are developing CIST itself or want the latest local version.
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
cp .env.example .env
Windows PowerShell:
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
Copy-Item .env.example .env
Install The Built CLI Wheel
If a wheel has already been built, install it directly:
python -m pip install dist/cist-<version>-py3-none-any.whl
Install The VS Code Extension
Build the repo once, then install the generated VSIX from VS Code.
python scripts/build.py
That produces:
dist/cist-<version>-py3-none-any.whlcist_cli/assets/cist-<version>.vsix
In VS Code, open Extensions, choose ..., then Install from VSIX... and select the file in cist_cli/assets/.
If you have the code shell command available, you can also run:
code --install-extension cist_cli/assets/cist-<version>.vsix
Quick Start
After installation, create a workspace and compile a sample contract:
cist init --path /tmp/test
cist validate /tmp/test/contracts/example.cis
CIST_CLOUD_API_KEY=sk_live_your_api_key_here cist compile /tmp/test/contracts/example.cis --verbose
The validate command is local-only. The compile command contacts the configured cloud endpoint.
How To Use CIST
Typical workflow:
- Initialize a folder with
cist init --path <dir>. - Edit the generated
.cisfile or add your own contracts undercontracts/. - Run
cist validate path/to/file.cisto catch local syntax issues before upload. - Run
cist compile path/to/file.cisto stream compile output from the cloud service. - Add
--deploywhen you want the cloud request to mark the compile as deployable/live.
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 Commands
cist init --path <dir>
- Creates a
contracts/directory. - Writes an
example.cisstarter contract if one does not already exist.
cist validate <file.cis>
- Checks UTF-8 decoding.
- Checks bracket and quote matching.
- Collects
useimports andfrom data (...)occurrences. - Reports mixed tabs/spaces as warnings.
cist compile <file.cis> [--verbose] [--deploy]
- Runs the same local validation first.
- Sends the contract to the configured cloud endpoint.
- Streams logs, artifacts, and errors back to the terminal.
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.1-py3-none-any.whl.
File metadata
- Download URL: cist_kernel-0.0.1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bd9c3a142e2c763eac43f14230d8bd4f3a8f9215cbfb73b5e4f8cbe238327a5
|
|
| MD5 |
3448fc470feb7eb46a99222f95f1fdde
|
|
| BLAKE2b-256 |
83c29f5f1fe93d82823cb861f8a3015a71f98d78ab6c76f4e2dc057b11280bdf
|