sanka-cli 0.1.5__tar.gz
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.
- sanka_cli-0.1.5/.github/workflows/ci.yml +32 -0
- sanka_cli-0.1.5/.github/workflows/release.yml +72 -0
- sanka_cli-0.1.5/.gitignore +11 -0
- sanka_cli-0.1.5/AGENTS.md +35 -0
- sanka_cli-0.1.5/CLAUDE.md +1 -0
- sanka_cli-0.1.5/LICENSE +21 -0
- sanka_cli-0.1.5/PKG-INFO +173 -0
- sanka_cli-0.1.5/README.md +154 -0
- sanka_cli-0.1.5/docs/commands.md +52 -0
- sanka_cli-0.1.5/docs/install.md +56 -0
- sanka_cli-0.1.5/docs/release.md +29 -0
- sanka_cli-0.1.5/packaging/homebrew/sanka.rb +136 -0
- sanka_cli-0.1.5/pyproject.toml +51 -0
- sanka_cli-0.1.5/sanka_cli/__init__.py +3 -0
- sanka_cli-0.1.5/sanka_cli/__main__.py +4 -0
- sanka_cli-0.1.5/sanka_cli/bundle.py +244 -0
- sanka_cli-0.1.5/sanka_cli/client.py +136 -0
- sanka_cli-0.1.5/sanka_cli/commands/__init__.py +1 -0
- sanka_cli-0.1.5/sanka_cli/commands/ai.py +106 -0
- sanka_cli-0.1.5/sanka_cli/commands/auth.py +111 -0
- sanka_cli-0.1.5/sanka_cli/commands/code.py +588 -0
- sanka_cli-0.1.5/sanka_cli/commands/profiles.py +35 -0
- sanka_cli-0.1.5/sanka_cli/commands/resources.py +112 -0
- sanka_cli-0.1.5/sanka_cli/commands/workflows.py +111 -0
- sanka_cli-0.1.5/sanka_cli/config.py +285 -0
- sanka_cli-0.1.5/sanka_cli/main.py +51 -0
- sanka_cli-0.1.5/sanka_cli/output.py +84 -0
- sanka_cli-0.1.5/sanka_cli/runtime.py +177 -0
- sanka_cli-0.1.5/sanka_cli/state.py +10 -0
- sanka_cli-0.1.5/scripts/install.sh +38 -0
- sanka_cli-0.1.5/scripts/render_homebrew_formula.py +245 -0
- sanka_cli-0.1.5/tests/test_cli.py +785 -0
- sanka_cli-0.1.5/tests/test_code_bundle.py +283 -0
- sanka_cli-0.1.5/tests/test_code_commands.py +362 -0
- sanka_cli-0.1.5/tests/test_render_homebrew_formula.py +43 -0
- sanka_cli-0.1.5/uv.lock +480 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v4
|
|
24
|
+
|
|
25
|
+
- name: Sync dependencies
|
|
26
|
+
run: uv sync --group dev
|
|
27
|
+
|
|
28
|
+
- name: Ruff
|
|
29
|
+
run: uv run ruff check .
|
|
30
|
+
|
|
31
|
+
- name: Tests
|
|
32
|
+
run: uv run pytest
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
release:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
id-token: write
|
|
15
|
+
environment:
|
|
16
|
+
name: pypi
|
|
17
|
+
url: https://pypi.org/p/sanka-cli
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.12"
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v4
|
|
30
|
+
|
|
31
|
+
- name: Sync dependencies
|
|
32
|
+
run: uv sync --group dev
|
|
33
|
+
|
|
34
|
+
- name: Ruff
|
|
35
|
+
run: uv run ruff check .
|
|
36
|
+
|
|
37
|
+
- name: Tests
|
|
38
|
+
run: uv run pytest
|
|
39
|
+
|
|
40
|
+
- name: Build distributions
|
|
41
|
+
run: uv build
|
|
42
|
+
|
|
43
|
+
- name: Generate Homebrew formula
|
|
44
|
+
run: |
|
|
45
|
+
VERSION="${GITHUB_REF_NAME#v}"
|
|
46
|
+
SHA256="$(shasum -a 256 "dist/sanka_cli-${VERSION}.tar.gz" | awk '{print $1}')"
|
|
47
|
+
uv run python scripts/render_homebrew_formula.py \
|
|
48
|
+
--version "${VERSION}" \
|
|
49
|
+
--sha256 "${SHA256}" \
|
|
50
|
+
--output packaging/homebrew/sanka.rb
|
|
51
|
+
|
|
52
|
+
- name: Create GitHub release
|
|
53
|
+
uses: softprops/action-gh-release@v2
|
|
54
|
+
with:
|
|
55
|
+
files: |
|
|
56
|
+
dist/*
|
|
57
|
+
packaging/homebrew/sanka.rb
|
|
58
|
+
|
|
59
|
+
- name: Upload Homebrew formula template
|
|
60
|
+
uses: actions/upload-artifact@v4
|
|
61
|
+
with:
|
|
62
|
+
name: homebrew-formula
|
|
63
|
+
path: packaging/homebrew/sanka.rb
|
|
64
|
+
|
|
65
|
+
# Runs last so a PyPI failure can never block the GitHub release +
|
|
66
|
+
# formula (v0.1.3 failed here and left no release). Trusted publishing
|
|
67
|
+
# via the pending publisher for sanka-cli (repo sankaHQ/sanka-cli,
|
|
68
|
+
# workflow release.yml, environment pypi). v1.14+ required: v1.13's
|
|
69
|
+
# bundled validator rejects the Metadata-Version 2.5 that uv build
|
|
70
|
+
# emits (this bit v0.1.4).
|
|
71
|
+
- name: Publish to PyPI
|
|
72
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# sanka-cli Agent Guide
|
|
2
|
+
|
|
3
|
+
Canonical agent instructions for this repo — `CLAUDE.md` symlinks here. Workspace-wide
|
|
4
|
+
rules and the repo map live in the sanka-project workspace repo (`../AGENTS.md`).
|
|
5
|
+
|
|
6
|
+
## What this is
|
|
7
|
+
|
|
8
|
+
Public command-line interface for Sanka — a thin wrapper over the public CRM and AI
|
|
9
|
+
API. Business logic stays on the server; the CLI handles developer API token auth and
|
|
10
|
+
refresh, local profile/config management, request construction, table/JSON output, and
|
|
11
|
+
polling for long-running workflow runs.
|
|
12
|
+
|
|
13
|
+
## Stack & layout
|
|
14
|
+
|
|
15
|
+
- Python ≥3.11, click + httpx + rich; keyring for token storage, platformdirs for config paths.
|
|
16
|
+
- Package `sanka_cli/`, tests in `tests/`, packaging assets in `packaging/`, install script at `scripts/install.sh`.
|
|
17
|
+
- Published to PyPI as `sanka-cli`; installable via `uv tool install sanka-cli` or the bootstrap script.
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv sync
|
|
23
|
+
uv run -- python -m pytest tests/ -q
|
|
24
|
+
uv run sanka --help
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Release flow
|
|
28
|
+
|
|
29
|
+
1. Bump `version` in `pyproject.toml`, tag and create a GitHub Release with the sdist (`sanka_cli-<ver>.tar.gz`).
|
|
30
|
+
2. Update the Homebrew tap: `../homebrew-cli/Formula/sanka.rb` pins the release `url` + `sha256` (plus vendored resource blocks) — it must be updated after every release or `brew install sankaHQ/cli/sanka` ships the old version.
|
|
31
|
+
|
|
32
|
+
## Gotchas
|
|
33
|
+
|
|
34
|
+
- Keep it thin: if a feature needs business logic, it belongs in the server API, not here.
|
|
35
|
+
- This repo is public — no internal URLs, workspace paths, or credentials in code, docs, or fixtures.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
AGENTS.md
|
sanka_cli-0.1.5/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanka
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sanka_cli-0.1.5/PKG-INFO
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: sanka-cli
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: Public command-line interface for Sanka
|
|
5
|
+
Project-URL: Homepage, https://github.com/sankaHQ/sanka-cli
|
|
6
|
+
Project-URL: Documentation, https://github.com/sankaHQ/sanka-cli/blob/main/README.md
|
|
7
|
+
Project-URL: Repository, https://github.com/sankaHQ/sanka-cli
|
|
8
|
+
Project-URL: Issues, https://github.com/sankaHQ/sanka-cli/issues
|
|
9
|
+
Author: Sanka
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Requires-Dist: click>=8.1.8
|
|
14
|
+
Requires-Dist: httpx>=0.27.2
|
|
15
|
+
Requires-Dist: keyring>=25.6.0
|
|
16
|
+
Requires-Dist: platformdirs>=4.3.6
|
|
17
|
+
Requires-Dist: rich>=13.9.4
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Sanka CLI
|
|
21
|
+
|
|
22
|
+
Thin command-line wrapper for Sanka's public CRM and AI API.
|
|
23
|
+
|
|
24
|
+
The CLI keeps business logic on the server. It handles:
|
|
25
|
+
- Developer API token auth and refresh
|
|
26
|
+
- local profile and config management
|
|
27
|
+
- request construction for CRM, workflow, and AI endpoints
|
|
28
|
+
- table or JSON output
|
|
29
|
+
- polling for long-running workflow runs
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
From PyPI:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv tool install sanka-cli
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Bootstrap script from a pinned release tag:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
curl -fsSLO https://raw.githubusercontent.com/sankaHQ/sanka-cli/v0.1.3/scripts/install.sh
|
|
43
|
+
sh install.sh
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
From a pinned GitHub release tag:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv tool install "git+https://github.com/sankaHQ/sanka-cli.git@v0.1.3"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Homebrew support is published through
|
|
53
|
+
[`sankaHQ/homebrew-cli`](https://github.com/sankaHQ/homebrew-cli). Install with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
brew tap sankaHQ/cli
|
|
57
|
+
brew install sankaHQ/cli/sanka
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If you previously installed `sanka` from the old `sankaHQ/tap` tap
|
|
61
|
+
(`sankaHQ/homebrew-tap`), remove that formula and untap it first:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
brew uninstall sanka
|
|
65
|
+
brew untap sankaHQ/tap
|
|
66
|
+
brew tap sankaHQ/cli
|
|
67
|
+
brew install sankaHQ/cli/sanka
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Authenticate
|
|
71
|
+
|
|
72
|
+
Create a Developer API Token in Sanka, then save it locally. Login verifies the
|
|
73
|
+
token against the API and prints the workspace and user it belongs to; a
|
|
74
|
+
rejected token is not saved. If the API is unreachable, the token is saved with
|
|
75
|
+
a warning so offline setup still works.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
sanka auth login --access-token "<ACCESS_TOKEN>"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Check the active profile:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
sanka auth status
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Command Areas
|
|
88
|
+
|
|
89
|
+
CRM records:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
sanka companies list
|
|
93
|
+
sanka contacts get <contact-id>
|
|
94
|
+
sanka deals create --data @deal.json
|
|
95
|
+
sanka tickets delete <ticket-id>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Workflow automation:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
sanka workflows list
|
|
102
|
+
sanka workflows run <workflow-ref>
|
|
103
|
+
sanka workflows run <workflow-ref> --wait
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Custom Code — write a workflow action in JavaScript or Python, keep it in your own
|
|
107
|
+
repository, and push versions to Sanka:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
sanka code init --slug enrich-company --runtime node
|
|
111
|
+
sanka code create
|
|
112
|
+
sanka code push --activate -m "add tier logic"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Your repository is the source of truth. Versions are immutable and content-addressed,
|
|
116
|
+
so pushing unchanged code returns the version that already exists — safe to run on
|
|
117
|
+
every CI merge. Rolling back is a pointer move, not a redeploy:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
sanka code versions enrich-company
|
|
121
|
+
sanka code rollback enrich-company # or: deploy --version 4
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`pull` writes a deployed version back to disk and `diff` reports whether your working
|
|
125
|
+
directory matches what is live. `diff` exits non-zero when they differ, which makes it
|
|
126
|
+
usable as a CI drift check:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
sanka code pull enrich-company --dir ./functions/enrich
|
|
130
|
+
sanka code diff --dir ./functions/enrich
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Secrets are per-function and never readable back — `list` shows only a masked suffix:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
sanka code secrets set enrich-company CLEARBIT_API_KEY # prompts, no echo
|
|
137
|
+
sanka code secrets list enrich-company
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Files are excluded from a push by `.sankaignore`; `.git`, `node_modules`,
|
|
141
|
+
`__pycache__`, `.venv`, build output, and `.env` are excluded by default.
|
|
142
|
+
|
|
143
|
+
AI helpers:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
sanka ai score company <record-id>
|
|
147
|
+
sanka ai score deal <record-id> --score-model-id <score-model-id>
|
|
148
|
+
sanka ai enrich company <record-id> --force-refresh
|
|
149
|
+
sanka ai enrich company --seed-name "Acme" --seed-url "https://acme.example" --dry-run
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Output Modes
|
|
153
|
+
|
|
154
|
+
The CLI defaults to table output on a TTY and JSON otherwise. Override this per
|
|
155
|
+
command when needed:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
sanka --output json companies list
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Environment Overrides
|
|
162
|
+
|
|
163
|
+
- `SANKA_PROFILE`
|
|
164
|
+
- `SANKA_BASE_URL`
|
|
165
|
+
- `SANKA_ACCESS_TOKEN`
|
|
166
|
+
|
|
167
|
+
These override stored profile values without persisting them.
|
|
168
|
+
|
|
169
|
+
## Docs
|
|
170
|
+
|
|
171
|
+
- [Install](docs/install.md)
|
|
172
|
+
- [Commands](docs/commands.md)
|
|
173
|
+
- [Release](docs/release.md)
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Sanka CLI
|
|
2
|
+
|
|
3
|
+
Thin command-line wrapper for Sanka's public CRM and AI API.
|
|
4
|
+
|
|
5
|
+
The CLI keeps business logic on the server. It handles:
|
|
6
|
+
- Developer API token auth and refresh
|
|
7
|
+
- local profile and config management
|
|
8
|
+
- request construction for CRM, workflow, and AI endpoints
|
|
9
|
+
- table or JSON output
|
|
10
|
+
- polling for long-running workflow runs
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
From PyPI:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uv tool install sanka-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Bootstrap script from a pinned release tag:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
curl -fsSLO https://raw.githubusercontent.com/sankaHQ/sanka-cli/v0.1.3/scripts/install.sh
|
|
24
|
+
sh install.sh
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
From a pinned GitHub release tag:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uv tool install "git+https://github.com/sankaHQ/sanka-cli.git@v0.1.3"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Homebrew support is published through
|
|
34
|
+
[`sankaHQ/homebrew-cli`](https://github.com/sankaHQ/homebrew-cli). Install with:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
brew tap sankaHQ/cli
|
|
38
|
+
brew install sankaHQ/cli/sanka
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If you previously installed `sanka` from the old `sankaHQ/tap` tap
|
|
42
|
+
(`sankaHQ/homebrew-tap`), remove that formula and untap it first:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
brew uninstall sanka
|
|
46
|
+
brew untap sankaHQ/tap
|
|
47
|
+
brew tap sankaHQ/cli
|
|
48
|
+
brew install sankaHQ/cli/sanka
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Authenticate
|
|
52
|
+
|
|
53
|
+
Create a Developer API Token in Sanka, then save it locally. Login verifies the
|
|
54
|
+
token against the API and prints the workspace and user it belongs to; a
|
|
55
|
+
rejected token is not saved. If the API is unreachable, the token is saved with
|
|
56
|
+
a warning so offline setup still works.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
sanka auth login --access-token "<ACCESS_TOKEN>"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Check the active profile:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
sanka auth status
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Command Areas
|
|
69
|
+
|
|
70
|
+
CRM records:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
sanka companies list
|
|
74
|
+
sanka contacts get <contact-id>
|
|
75
|
+
sanka deals create --data @deal.json
|
|
76
|
+
sanka tickets delete <ticket-id>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Workflow automation:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
sanka workflows list
|
|
83
|
+
sanka workflows run <workflow-ref>
|
|
84
|
+
sanka workflows run <workflow-ref> --wait
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Custom Code — write a workflow action in JavaScript or Python, keep it in your own
|
|
88
|
+
repository, and push versions to Sanka:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
sanka code init --slug enrich-company --runtime node
|
|
92
|
+
sanka code create
|
|
93
|
+
sanka code push --activate -m "add tier logic"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Your repository is the source of truth. Versions are immutable and content-addressed,
|
|
97
|
+
so pushing unchanged code returns the version that already exists — safe to run on
|
|
98
|
+
every CI merge. Rolling back is a pointer move, not a redeploy:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
sanka code versions enrich-company
|
|
102
|
+
sanka code rollback enrich-company # or: deploy --version 4
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`pull` writes a deployed version back to disk and `diff` reports whether your working
|
|
106
|
+
directory matches what is live. `diff` exits non-zero when they differ, which makes it
|
|
107
|
+
usable as a CI drift check:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
sanka code pull enrich-company --dir ./functions/enrich
|
|
111
|
+
sanka code diff --dir ./functions/enrich
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Secrets are per-function and never readable back — `list` shows only a masked suffix:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
sanka code secrets set enrich-company CLEARBIT_API_KEY # prompts, no echo
|
|
118
|
+
sanka code secrets list enrich-company
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Files are excluded from a push by `.sankaignore`; `.git`, `node_modules`,
|
|
122
|
+
`__pycache__`, `.venv`, build output, and `.env` are excluded by default.
|
|
123
|
+
|
|
124
|
+
AI helpers:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
sanka ai score company <record-id>
|
|
128
|
+
sanka ai score deal <record-id> --score-model-id <score-model-id>
|
|
129
|
+
sanka ai enrich company <record-id> --force-refresh
|
|
130
|
+
sanka ai enrich company --seed-name "Acme" --seed-url "https://acme.example" --dry-run
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Output Modes
|
|
134
|
+
|
|
135
|
+
The CLI defaults to table output on a TTY and JSON otherwise. Override this per
|
|
136
|
+
command when needed:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
sanka --output json companies list
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Environment Overrides
|
|
143
|
+
|
|
144
|
+
- `SANKA_PROFILE`
|
|
145
|
+
- `SANKA_BASE_URL`
|
|
146
|
+
- `SANKA_ACCESS_TOKEN`
|
|
147
|
+
|
|
148
|
+
These override stored profile values without persisting them.
|
|
149
|
+
|
|
150
|
+
## Docs
|
|
151
|
+
|
|
152
|
+
- [Install](docs/install.md)
|
|
153
|
+
- [Commands](docs/commands.md)
|
|
154
|
+
- [Release](docs/release.md)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Commands
|
|
2
|
+
|
|
3
|
+
## Authentication
|
|
4
|
+
|
|
5
|
+
`auth login` verifies the token against the API before saving it and prints the
|
|
6
|
+
workspace, user, and token name on success.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
sanka auth login --access-token "<ACCESS_TOKEN>"
|
|
10
|
+
sanka auth status
|
|
11
|
+
sanka auth logout
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Profiles
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
sanka profiles list
|
|
18
|
+
sanka profiles use prod
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## CRM
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
sanka companies list
|
|
25
|
+
sanka companies get <company-id>
|
|
26
|
+
sanka contacts get <contact-id>
|
|
27
|
+
sanka deals create --data @deal.json
|
|
28
|
+
sanka tickets delete <ticket-id>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Workflows
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
sanka workflows list
|
|
35
|
+
sanka workflows get <workflow-ref>
|
|
36
|
+
sanka workflows run <workflow-ref> --wait
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## AI
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
sanka ai score company <record-id>
|
|
43
|
+
sanka ai score deal <record-id> --score-model-id <score-model-id>
|
|
44
|
+
sanka ai enrich company <record-id> --force-refresh
|
|
45
|
+
sanka ai enrich company --seed-name "Acme" --seed-url "https://acme.example" --dry-run
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
sanka --output json companies list
|
|
52
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Install
|
|
2
|
+
|
|
3
|
+
## From PyPI
|
|
4
|
+
|
|
5
|
+
This is the default install path:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uv tool install sanka-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Bootstrap Script
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl -fsSLO https://raw.githubusercontent.com/sankaHQ/sanka-cli/v0.1.3/scripts/install.sh
|
|
15
|
+
sh install.sh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The script requires `uv` to be installed already and installs the pinned PyPI
|
|
19
|
+
release by default. If a fallback is needed, set `SANKA_CLI_FALLBACK_SPEC` to an
|
|
20
|
+
exact version or pinned Git ref, such as `sanka-cli==0.1.3` or
|
|
21
|
+
`git+https://github.com/sankaHQ/sanka-cli.git@v0.1.3`.
|
|
22
|
+
|
|
23
|
+
## From GitHub
|
|
24
|
+
|
|
25
|
+
Use an immutable tag, not the moving default branch:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
uv tool install "git+https://github.com/sankaHQ/sanka-cli.git@v0.1.3"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Homebrew
|
|
32
|
+
|
|
33
|
+
Tagged releases generate `packaging/homebrew/sanka.rb` with the exact release checksum,
|
|
34
|
+
and the published tap lives in [`sankaHQ/homebrew-cli`](https://github.com/sankaHQ/homebrew-cli):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
brew tap sankaHQ/cli
|
|
38
|
+
brew install sankaHQ/cli/sanka
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If you installed an older preview from `sankaHQ/tap`
|
|
42
|
+
(`sankaHQ/homebrew-tap`), remove the old formula and untap it before
|
|
43
|
+
installing from the new tap:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
brew uninstall sanka
|
|
47
|
+
brew untap sankaHQ/tap
|
|
48
|
+
brew tap sankaHQ/cli
|
|
49
|
+
brew install sankaHQ/cli/sanka
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Local Development
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
uv tool install .
|
|
56
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Release
|
|
2
|
+
|
|
3
|
+
This repository is the public source for the `sanka` CLI. Tagged releases build the
|
|
4
|
+
Python distributions, run tests, and generate the Homebrew formula from the release
|
|
5
|
+
artifact checksum.
|
|
6
|
+
|
|
7
|
+
## Release Flow
|
|
8
|
+
|
|
9
|
+
1. Update `sanka_cli/__init__.py` and `pyproject.toml` to the release version.
|
|
10
|
+
2. Create and push a tag such as `v0.1.0`.
|
|
11
|
+
3. GitHub Actions builds the sdist and wheel, runs Ruff and pytest, and attaches the
|
|
12
|
+
artifacts to the GitHub release.
|
|
13
|
+
4. The release workflow renders `packaging/homebrew/sanka.rb` with the exact checksum
|
|
14
|
+
for the tagged sdist and uploads that formula as a release artifact.
|
|
15
|
+
5. Copy the generated formula into `sankaHQ/homebrew-cli`.
|
|
16
|
+
6. Publish to PyPI when the repository has a configured `PYPI_API_TOKEN`.
|
|
17
|
+
|
|
18
|
+
## Homebrew Formula
|
|
19
|
+
|
|
20
|
+
The formula in this repo is generated, not hand-maintained. Re-render it locally with:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uv run python scripts/render_homebrew_formula.py \
|
|
24
|
+
--version 0.1.0 \
|
|
25
|
+
--sha256 <sha256-of-sanka_cli-0.1.0.tar.gz> \
|
|
26
|
+
--output packaging/homebrew/sanka.rb
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The formula points at the GitHub release asset for the matching version.
|