ana-cli

module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT

README

ana-cli

ana is a command-line client for TextQL. It speaks the Connect-RPC endpoints that power the TextQL web app and exposes them as a scriptable CLI for automation, CI pipelines, and power-user workflows.

Installation

Install script (linux / macOS)
curl -fsSL https://raw.githubusercontent.com/highperformance-tech/ana-cli/main/install.sh | sh

Installs the latest release into /usr/local/bin/ana. Override with INSTALL_DIR=$HOME/.local/bin.

go install
go install github.com/highperformance-tech/ana-cli/cmd/ana@latest
Download a release archive

Grab the matching ana_<version>_<os>_<arch>.tar.gz (or .zip on Windows) from the releases page, extract the ana binary, and drop it on your PATH. Each release ships a checksums.txt you can verify with sha256sum -c checksums.txt.

Build from source
git clone https://github.com/highperformance-tech/ana-cli.git
cd ana-cli
make build
./bin/ana --version

Windows users: see docs/windows-smartscreen.md.

Usage

ana [global flags] <command> [args]
ana auth login --endpoint https://app.textql.com
ana org show
ana connector list
ana chat send "show me last month's revenue"
ana api textql.rpc.public.auth.PublicAuthService/GetOrganization   # raw JSON passthrough
ana update  # replace the running binary with the latest release
ana api — raw authenticated passthrough

ana api <path> sends an authenticated HTTP request and prints the response. Two path forms:

  • <service>/<Method> — Connect-RPC short form, prefixed with /rpc/public/.
  • /v1/... (or any leading-slash path) — sent verbatim. Covers both the documented REST API (docs.textql.com/api-reference) and pre-resolved RPC paths.

Body can be supplied with --data '<json>' or --data-stdin. Default method is POST with a {} body (so short-form RPC calls Just Work); GET/HEAD auto-omit the body. --raw passes the response through verbatim instead of pretty-printing.

Run ana --help or ana <verb> --help for command-specific flags.

ana checks GitHub for a newer release after each verb and prints a one-line stderr nudge when one exists. The result is cached for 4 h by default; set updateCheckInterval in config.json (any time.ParseDuration-compatible value) to change the cadence, or "0" / "disable" to turn the check off. --json suppresses the nudge so automation pipelines aren't broken.

Configuration

ana stores tokens and per-profile endpoints at $XDG_CONFIG_HOME/ana/config.json (falling back to ~/.config/ana/config.json).

Development

make test          # go test -race ./...
make cover         # enforces 100% coverage on internal/...
make lint          # gofmt, go vet, staticcheck
make build         # -> ./bin/ana
make release-local # goreleaser check + snapshot (requires goreleaser)

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
ana command
Command ana is the TextQL platform CLI.
Command ana is the TextQL platform CLI.
e2e
harness
Package harness wires the ana CLI against a real TextQL endpoint for live smoke tests.
Package harness wires the ana CLI against a real TextQL endpoint for live smoke tests.
internal
api
Package api provides the `ana api` verb — an authenticated raw-JSON passthrough over the shared transport client.
Package api provides the `ana api` verb — an authenticated raw-JSON passthrough over the shared transport client.
audit
Package audit provides the `ana audit` verb tree: tail.
Package audit provides the `ana audit` verb tree: tail.
auth
Package auth provides the `ana auth` verb tree: login, logout, whoami, and the nested `keys` and `service-accounts` groups.
Package auth provides the `ana auth` verb tree: login, logout, whoami, and the nested `keys` and `service-accounts` groups.
chat
Package chat provides the `ana chat` verb tree: new/list/show/history/send (streaming) plus rename, bookmark/unbookmark, duplicate, delete, and share.
Package chat provides the `ana chat` verb tree: new/list/show/history/send (streaming) plus rename, bookmark/unbookmark, duplicate, delete, and share.
cli
Package cli provides argument-dispatch glue for the ana CLI.
Package cli provides argument-dispatch glue for the ana CLI.
config
Package config reads and writes the ana CLI configuration file.
Package config reads and writes the ana CLI configuration file.
connector
Package connector provides the `ana connector` verb tree: list, get, create, update, delete, test, tables, examples.
Package connector provides the `ana connector` verb tree: list, get, create, update, delete, test, tables, examples.
dashboard
Package dashboard provides the `ana dashboard` verb tree: list, folders, get, spawn, health.
Package dashboard provides the `ana dashboard` verb tree: list, folders, get, spawn, health.
feed
Package feed provides the `ana feed` verb tree: show (posts) and stats.
Package feed provides the `ana feed` verb tree: show (posts) and stats.
ontology
Package ontology provides the `ana ontology` verb tree: list and get.
Package ontology provides the `ana ontology` verb tree: list and get.
org
Package org provides the `ana org` verb tree: show, members, roles, and permissions.
Package org provides the `ana org` verb tree: show, members, roles, and permissions.
playbook
Package playbook provides the `ana playbook` verb tree: list, get, reports, and lineage.
Package playbook provides the `ana playbook` verb tree: list, get, reports, and lineage.
profile
Package profile provides the `ana profile` verb tree: list, add, use, remove, and show.
Package profile provides the `ana profile` verb tree: list, add, use, remove, and show.
testcli
Package testcli provides helpers for verb-package unit tests.
Package testcli provides helpers for verb-package unit tests.
transport
Package transport provides a Connect-RPC-over-JSON client used by ana-cli to talk to the TextQL backend.
Package transport provides a Connect-RPC-over-JSON client used by ana-cli to talk to the TextQL backend.
update
Package update powers the passive update nudge (CachedCheck) and the `ana update` self-update verb (SelfUpdate).
Package update powers the passive update nudge (CachedCheck) and the `ana update` self-update verb (SelfUpdate).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL