Projects
Project tree
This tree contains first-party products and reusable project code. All tracked
content follows the repository’s public-source policy.
Each project owns its specifications and maintained changes in
<project>/openspec/. Use the pinned OpenSpec workflow
with that project selected. infra/src/ owns repository evolution.
Requirements
- Bazel targets MAY use public visibility when their owner intends external
reuse.
- Project artifacts MAY be published through an explicit release workflow.
- Project targets MAY be used by production build targets.
Project status
Each direct project README declares exactly one statuses value from
statuses.yaml.
The README owns the declaration. The definitions, index statuses, and existing
landing-page status fields are generated by
bazel run //tools/repo_quality:inventory_update; the inventory freshness check
rejects invalid declarations and stale projections. Edit the README before
running the updater. Keep release readiness and known limitations in project
prose; lifecycle alone does not establish build health or deployment state.
| Status | Meaning |
|---|
active | Substantive feature development is currently underway. Unfinished plans or routine upkeep alone do not qualify. |
archived | Retained for reference; no further development or maintenance is intended. |
completed | The intended scope is declared complete. This does not promise ongoing maintenance, compatibility, or a published release. |
maintenance | Retained with upkeep as needed and no current feature development. Scope may still be unfinished or limited. |
Project sites
Projects selected in projects.bzl publish landing pages with the main website
at https://alwaldend.com/projects/<name>/. Repository reference documentation,
including each project README, lives under /docs/. The index below is generated
from the README metadata of every project; landing membership remains an explicit
publication decision.
1 - ActivityWatch ingester Android
Accessibility-based Android collector that sends browser URLs to ActivityWatch
ActivityWatch ingester Android
An Android collector that reads supported browser address-bar text through
Android accessibility and sends it to an ActivityWatch server. The app holds
full accessibility permission only to obtain the URL; it never uses that
permission for anything else.
How it works
- Enabling accessibility for this app lets it read the focused address bar.
- The accessibility service matches browser view IDs (
url_bar and common
Chrome-derived variants), extracts the current URL, and sends an
ActivityWatch heartbeat for the web.tab.current bucket to a configurable
server. web.tab.current heartbeats use pulsetime=1.0; consecutive URLs are sent
with the time spent on the previous tab as the duration field.- Data goes directly from this app to the ActivityWatch HTTP API; it is not
uploaded to any other service.
Configuration
Open the app to configure:
- ActivityWatch server URL — the base URL of the ActivityWatch server.
The default is
http://127.0.0.1:5600 for the ActivityWatch Android app on
the same device. Changes are saved immediately. - API key (optional) — bearer token sent as
Authorization: Bearer ...
when the ActivityWatch server has API authentication enabled.
The INTERNET permission is required to reach the ActivityWatch HTTP API. The
default loopback URL is sent over cleartext HTTP only to 127.0.0.1 and
localhost, so no host data leaves the device.
Supported browsers
Chrome and Chromium-based browsers that expose the url_bar view ID
(including ordinary Chrome and many Chrome-based forks). Firefox, Samsung
Internet, Opera, and Edge do not use that view ID yet.
Build and install
- Build the APK:
bazel build //projects/activitywatch_ingester_android/cmd/ingester:ingester_binary - Verify the APK starts on an already running device or emulator:
bazel run //projects/activitywatch_ingester_android/test:ingester_smoke_test
This manual smoke test installs the Bazel-built APK, launches the activity,
waits for the process, and confirms it stays alive. It is not a CI test. - Install the APK on the device from
bazel-bin/projects/activitywatch_ingester_android/cmd/ingester/ingester_binary.apk. - Start the app and set the ActivityWatch server URL.
- Enable accessibility for the app in Android settings; Android shows the
full-access warning, which is the mechanism this collector is built on.
- Open a browser. The current URL is re-sent to ActivityWatch whenever the
address bar changes.
Compatibility
- Minimum Android SDK 25 (Android 7.0).
- Tested against the ActivityWatch v0.13 HTTP API (
POST /api/0/buckets and
POST /api/0/buckets/web.tab.current/heartbeat).
Landing page
The project page
is built from the project’s site/content/_index.md.
Release APK
Build from the selected releases/YYYY.W branch using the
weekly release workflow. Bazel stamps the
release version and derives its Android version code before packaging.
bazel build --config=release //projects/activitywatch_ingester_android/cmd/ingester:ingester_binary
mkdir -p out/release-apks
bazel run //projects/activitywatch_ingester_android:sign_apk -- \
--input bazel-bin/projects/activitywatch_ingester_android/cmd/ingester/ingester_binary_unsigned.apk \
--output out/release-apks/activitywatch_ingester_android.apk
The signing target uses the app’s existing certificate and
Vault Transit key.
2 - AL
Repository lifecycle commands and reusable Bazel rules
AL is an independent project providing repository lifecycle commands and reusable
Bazel rules. Its source lives in projects/al; its Bzlmod module name remains
rules_al, preserving consumers’ @rules_al labels.
Its direct commands are al config, al run, al version, al release,
al delivery, al bazel test, and al doctor.
Consumers supply plugin configuration, repository and base selections, and release
destinations. They run their normal build, test, and lint commands before source
publication. Calendar versioning, aggregate-commit rules, and scratch conventions
are integration contracts that a consuming repository provides or adopts.
This repository’s configuration and installation wrapper live
in tools/al. The examples and verification evidence
below cover this repository and its isolated fixtures.
The product description follows the
operator-visible command lifecycle, interruption and recovery boundaries, with
verification checklists and source-linked defect triage.
The executable owns signals and startup. internal/cli assembles command adapters;
local release, delivery, versioning, Git, and Bazel packages retain their domain
operations and guards. Reusable configuration, plugin and resource-lifetime APIs
live in pkg/. CLI entry points use the same owning implementations as Bazel
execution tools. Credential plugins start through al run; ordinary lifecycle
inspection and artifact generation do not start them.
AL’s public Bazel API is @rules_al//:defs.bzl, including composable configuration targets, al_config aggregation and small
dictionary inputs, AL run wrappers, release packaging rules, and their providers. The module supplies its
own AL execution toolchain. Existing pinned dependencies are declared locally.
From this repository’s root, build the executable with
bazel build //projects/al:al, or install it with
bazel run //tools/al:install; installation requires the operator’s authority.
Use ordinary Bazel commands for builds and tests. For Git-aware test selection,
al bazel test --base master selects affected tests in the chosen workspace;
--dry-run previews that selection. See the
affected-test reference.
The
repository setup guide describes
per-user Bazel defaults, and Bazel setup describes AL
installation and diagnostics. Release stamping uses the installed al on PATH;
update that installation before building a release from changed AL source.
Operator procedures live in the module’s al-* skills. Workspace preparation,
checks, maintenance, and OpenSpec workflows use existing targets through those
skills; they do not add speculative command groups.
AL also owns repository versions and independent project releases.
The release identity is (project, version): projects share a source version
and process, while each publishes and activates independently. Operators can
run the entire process without CI.
Bazel module API
Consumers depend on rules_al and load its al_-prefixed rules from
@rules_al//:defs.bzl: al_release, al_release_files, al_release_bundle,
al_release_binary, al_release_deployment, and al_release_deps. Providers are
AlReleaseInfo, AlReleaseFilesInfo, and AlReleaseDeploymentInfo.
load("@rules_al//:defs.bzl", "al_release_bundle")
al_release_bundle(
name = "release",
srcs = [":archive"],
project = "projects/example",
)
status_file can supply an explicit stable-status file. Otherwise the bundle
consumes Bazel workspace status when stamping is enabled, and ordinary unstamped
builds emit the constant development version. The standard stamp attribute
controls this behavior. The module builds its own tool and declares
all software dependencies at repository pins. From the monorepo root, run bazel test //projects/al/... and
bazel build //projects/al/.... The release archive retains the standalone module
manifest.
The tests/consumer:check command builds the public API without parent Bazel
configuration imports and automatically verifies its output manifest and payload.
Its README describes launcher invocation and the retained result.json.
Release manifests carry the minimal version, channel, source commit, and tree
state needed to identify a build. Optional GitBundle history supplies changelogs;
AL does not export a complete repository-history JSON document. The exported
git extension configures a consumer’s local checkout and system Git executable;
register the resulting git_toolchain to use @rules_al//:git or al_git_binary.
History generation deliberately reads that checkout locally and is excluded from
remote execution/cache upload. Ordinary portable bundle generation uses only
declared inputs.
git = use_extension("@rules_al//:extensions.bzl", "git")
git.local_git(name = "repository_git")
use_repo(git, "repository_git")
register_toolchains("@repository_git//:git_toolchain")
The al_release documentation rule accepts optional git_bundle and page_template
inputs. This repository’s website supplies its history bundle and shared Hugo
markup through //projects/alwaldend.com/pkg/release_pages:defs.bzl.
Consumers supply their own history and page-template inputs to the module API.
Prepare source
The calendar-version contract remains:
- development:
0.0.0-dev; - nightly trunk tag:
vYYYY.M.D-nightly, using the UTC date once per day; - weekly branch:
releases/YYYY.W; - release tag:
vYYYY.W.PATCH, with patch zero at the branch point and one
increment for every subsequent first-parent commit.
Weekly releases use the ISO week-year and week. The week, nightly month,
and nightly day are unpadded. Inspect source with al version show --format json.
Version operations use native Cobra subcommands: al help version show describes
their flags, and shared flags work before or after the subcommand. Select another
checkout with --repository PATH.
SIGINT and SIGTERM cancel active Git subprocesses. Foreground
Git authentication can use the controlling terminal; AL restores terminal ownership
after the child exits.
Use al version nightly-tag, al release create, or al version release-tag
for explicitly authorized local ref preparation. Each supports --dry-run.
The al-versioning skill documents detached-checkout and calendar details.
For a weekly release, start on clean trunk and run al release create. It
atomically creates releases/YYYY.W and vYYYY.W.0 at trunk HEAD, leaving the
current checkout unchanged. Select the created branch with ordinary Git before
planning source publication or building release artifacts. Use the branch name
printed by create in place of releases/YYYY.W below:
al release create --dry-run
al release create
git checkout releases/YYYY.W
Review and publish the shared source refs:
al version release-plan \
--lease weekly-release --plan out/release/source-plan.json
al version release-publish \
--plan out/release/source-plan.json --receipt out/release/source-receipt.json
Source publication uses a Git-common-directory operation lock, guarded creates,
atomic push, and remote verification. Existing tags are reused only at the
same commit. For a patch, commit and tag on the weekly branch, deliver the
branch normally, then publish its tag; trunk may have diverged. Shared tags
are not project publication status. A stale release-refs.lock directory after
a killed process must be investigated before an operator removes it.
Build one project
bazel build --config=release //projects/autoscroll/releases:bundle
Projects with declared first-party payloads have a releases:bundle target.
The website’s bundle aliases //projects/alwaldend.com:release. The Android,
kustomization, and Terraform module release pages currently declare no payloads;
they provide documentation until their owners define release artifacts.
Existing head release pages are development documentation, not publishable
release identities. Nightly-to-weekly promotion rebuilds version-bearing
artifacts under the weekly identity.
al_release_bundle packages declared payloads as release.json and
files/<filename> in a Bazel directory output. It consumes STABLE_VERSION,
STABLE_VERSION_CHANNEL, STABLE_GIT_COMMIT, and STABLE_GIT_TREE_STATE from
the workspace-status command. First-party publication requires a concrete nightly or
release version and clean source identity. Development bundle manifests and
payloads can be examined locally; release plan, release inspect, and
publication require a publishable identity. Third-party versions continue to
come from their dependency owner.
The build does not contact deployment destinations.
The root release configuration enables stamping and invokes
al version --repository . bazel-status through the workspace-status script.
Install AL before starting the build; the script does not bootstrap a nested
Bazel invocation. Source refs choose the version, and dirty nightly or weekly
source fails stamping. For an ambiguous detached checkout, override
--workspace_status_command with the same status command and explicit
--channel or --release selection.
The CLI equivalent is al release generate --project projects/<name> --version_file <status-file> --add_file <payload> --output_dir <empty-directory>. Repeat
--add_file for multiple payloads. Missing or duplicate status values, unsafe
paths, missing payloads, colliding filenames, and empty bundles fail. The
output directory must be absent or empty. A completed manifest is written
only after payload copying finishes.
Publish over SSH
SSH publication uses the operator’s OpenSSH and rsync executables and requires
rsync and standard GNU filesystem utilities (including flock and mountpoint)
on the destination. No receiver service is installed. Select the environment and
destination explicitly:
bazel run @rules_al//:al -- release publish \
--release_dir "$PWD/bazel-bin/projects/autoscroll/releases/bundle" \
--environment local --ssh_host download-host --ssh_user admin \
--publish_user download --ssh_root /srv/download
The download component provides preconfigured //infra/download:publish.local
and //infra/download:publish.yandex commands. These use the configured SSH
administrator and content account; provision the selected host first.
--ssh_deployment accepts a deployment JSON
with an ssh object. Explicit host or deployment selection publishes every
manifest item; otherwise --environment selects matching SSH item metadata.
OCI manifest/page generation remains available, but OCI publication fails
closed: the former mutable-tag push cannot enforce immutable releases. Select
an SSH destination for publication. An empty selection fails.
Host trust and authentication use normal OpenSSH configuration with strict
host-key checks and noninteractive authentication. --ssh_config,
--ssh_identity, --ssh_certificate, --ssh_disable_agent, --ssh_known_hosts,
--ssh_port, and --ssh_user provide local overrides. Credentials never enter
manifests. Remote commands start from / so the content account does not need
to traverse the administrator’s private home. --ssh_path and --rsync_path select installed executables; the
default deadline is 30 minutes (--timeout).
The public project defaults to the manifest project without projects/;
--project overrides it. --namespace third_party selects external artifacts.
The public layout is <root>/<namespace>/<project>/releases/<version>/<filename>.
Publication copies the complete selected set to private staging, verifies sizes
and SHA-256 hashes locally and remotely, then atomically renames the completed
release under a destination lock. A canonical public release.json binds the
identity and payload set without transport configuration. Directories are
0755, payloads 0644. Shell arguments preserve literal values.
Identical existing releases are verified under the destination lock and succeed
without local payloads, staging, or another transfer. New publications retain a
final locked check after transfer to handle concurrent publishers. Conflicting manifests,
extra files, and corrupt payloads fail. Failed transfers expose no partial new
release. Directories from the former overwrite workflow must be explicitly
deleted before publication through this contract.
Use --receipt /absolute/path/to/attempt.json with artifact publish/delete or
website extract/activate to checkpoint local operation evidence. The private JSON receipt binds the selected
namespace, project, version, source commit, canonical publication digest and resolved
SSH environment/host/root. It records each requested step as pending, unknown
when started, and completed after confirmation. A failed operation preserves
completed steps and leaves an unconfirmed step unknown; even a transport error can
occur after a remote change. status is running, completed, or incomplete.
A killed process may leave running evidence with an unknown step. Use a separate
receipt path for each attempt to preserve history. Receipt persistence must succeed
before remote work starts. Receipts are observations, not authorization or proof
of current remote state. Inspect the destination and compare its publication
digest and observed state with the receipt, then retry any unresolved intended
step. Inspection does not rewrite receipts or authorize recovery operations.
Preview and inspect artifact publication
release plan previews artifact upload using the same bundle selection,
destination overrides, and source identity validation as release publish.
This is separate from version release-plan, which plans Git refs. Website
commands provide their own offline preview through --dry-run.
al release plan --release_dir "$PWD/out/site-release" \
--environment local --ssh_host download-host --ssh_root /srv/download
al release inspect --release_dir "$PWD/out/site-release" \
--environment local --ssh_host download-host --ssh_root /srv/download
The plan emits release/artifact_plan/v1 JSON with mode: offline_metadata.
It reports project/version/source, exact selected payload names, sizes and
hashes, canonical publication digest, destination, public/site paths and steps.
selection identifies explicit host/deployment overrides, which select all
items, or environment selection. Matching destinations are processed in stable
order. The plan reads bundle metadata only: it does not check payload bytes,
contact SSH or rsync, initialize credentials, or claim remote readiness. Missing
local payloads therefore do not prevent previewing an identical publication retry.
The destination includes configured login/content accounts; port and
ssh_user are null when OpenSSH owns their resolution, and publish_user is
null when commands run directly as the SSH login account. Authentication file
paths and credential contents are omitted.
Inspection emits release/artifact_inspection/v1 JSON with
mode: read_only_snapshot and a completion timestamp. It independently reports
each local payload as verified, missing, corrupt, or unreadable and reads
the destination through bounded, noninteractive SSH. Local failures do not
prevent remote inspection. The destination content root must already exist.
| Remote status | Observed meaning |
|---|
absent | No publication exists at the selected version path. |
matching | Canonical manifest, complete file set, sizes, and SHA-256 hashes match. |
conflicting | The regular public manifest differs from the expected canonical bytes. |
corrupt | The path or file types are unsafe, or the expected publication has invalid payloads or extra/missing files. |
unavailable | Transport, timeout, read access, missing content root, or response validation prevented a reliable observation. |
For first-party sites, site.status is absent, retained, active,
conflicting, or corrupt; it is not_applicable for external artifacts and
unavailable when the read fails. A site check verifies the publication binding
and regular root index.html, not every extracted file. site.active independently
reports whether current selects this version, including a corrupt or missing
site, and is null when selection is unknown. site.current distinguishes
absent, selected, other, dangling, and unsafe links. A valid retained
site can therefore have unknown selection if current is unsafe.
Completed inspections exit zero even when they find absent, conflicting, or
corrupt state. Unavailable observations emit their report and exit nonzero;
invalid local metadata fails before an observation report. Cancelling local
verification stops hashing between chunks and prevents the destination read;
no completed snapshot is produced. Neither command
accepts --receipt. Inspection creates no remote locks, staging directories,
or repairs, and uses no rsync transfers. The configured timeout bounds each
destination read; each captured stream is capped at 16 KiB and overflow cancels
the command. This is an observation without a lock, so concurrent publication
or deletion can change the state during or after inspection.
Extract and activate a website
al release publish uploads artifacts. Run al release website extract to create a
retained site from a published archive, then al release website activate to select it.
These are independent commands; neither uploads artifacts. Website commands
accept the same bundle and SSH destination selectors as publication and apply
only to first-party projects.
--site_archive belongs only to extraction; activation and inspection derive
site state from the selected publication and retained binding.
bazel run //infra/download:publish.yandex -- \
--release_dir "$PWD/out/site-release"
bazel run //infra/download:website.extract.yandex -- \
--release_dir "$PWD/out/site-release" \
--site_archive website.tar.gz
bazel run //infra/download:website.activate.yandex -- \
--release_dir "$PWD/out/site-release"
Use .local instead of .yandex for the local environment. Direct CLI commands
take explicit destination flags, for example:
al release website extract --release_dir "$PWD/out/site-release" \
--environment local --ssh_host download-host --ssh_root /srv/download \
--site_archive website.tar.gz --dry-run
al release website activate --release_dir "$PWD/out/site-release" \
--environment local --ssh_host download-host --ssh_root /srv/download --dry-run
Each --dry-run returns the offline metadata plan for that one operation. It
does not inspect archive bytes or remote state, contact SSH, or write a receipt.
Remove --dry-run to perform the chosen operation. Mutating commands accept
--receipt; combining it with --dry-run fails. Use al release inspect for
read-only publication, retained-site, and current-selection observations.
Extraction accepts a declared .tar.gz or .zip archive containing a root
index.html. It retrieves and verifies the published archive, extracts locally,
and promotes the site to sites/<project>/releases/<version>. Local free space
must hold both archive and extracted content. Traversal, absolute paths, links,
devices, duplicate names, and more than 100,000 entries fail. Archive ownership,
executable bits, and extended attributes are not retained.
Retained sites carry a binding to the exact publication. Activation checks this
binding and the public payloads under the destination lock, then atomically
selects sites/<project>/current. Managed ancestry must use real directories without nested mounts. Activation
also rejects mounts within the selected extracted site. Failed earlier steps leave activation
unchanged. Roll back by selecting another retained release with al release website activate.
Delete and republish
Use the same manifest and explicit SSH destination with delete:
bazel run @rules_al//:al -- release delete \
--release_dir "$PWD/out/site-release" --environment local \
--ssh_host download-host --ssh_root /srv/download
Deletion removes the project release and its extracted site at that destination.
It refuses the currently selected website: first select another retained release
with al release website activate. Deletion refuses symlinked ancestry and mounted target directories or descendants, including bind-mounted files,
before either tree is removed. Deleting an absent release succeeds. Shared source tags
remain. No tombstone or restoration manifest is retained; ordinary publish
works again after deletion, including with different artifact bytes.
Infrastructure synchronization
The download component owns the explicit local-to-public Ansible mirror through
//infra/download:sync.yandex. AL publication preserves immutable identities; the
separate mirror replaces public content from the authoritative local store and
removes public-only content. It preserves locally retained archives and sites.
See the download runbook for check-mode preview,
serialization, staging, and failure boundaries. AL has no synchronization command.
The manual //infra/download/test/sync:sync_test fixture uses real loopback SSH,
rsync, and an isolated mount namespace to exercise AL publication and the packaged
Ansible mirror. Its receipt records hashes, permissions, links, and failure cases.
Plugins
The built-in injector evaluates named resource graphs
inside AL and owns generic environment, file and process resources. Eligible
plugins advertise resource types in their startup response and supply
them through generic resource-fetch RPCs. Startup returns an extensible
PluginStartResponse with an optional generic result; fetches return ResourceResult
directly. The standalone Vault provider
owns Vault-specific resources. See the configuration API.
2.1 - AL Bazel rules
Configuration, command, Git, and release rules
AL rules and macros use the al_ prefix; AL providers use the Al prefix.
Their source filenames follow the same prefix in snake case. The public API is
exported through @rules_al//:defs.bzl, with usage documented in
the project README.
Configuration targets
Declare small al_vault_auth, al_vault_conn, al_plugin_config and
al_plugin targets, then combine their labels with al_config(configs = ...).
Keep short, single-use declarations in BUILD, including small dictionaries and
direct calls to existing macros. Extract namespaced local defs.bzl macros only
when they provide significant reuse or make complex graphs, construction logic,
long templates or bulky settings substantially easier to read. A single KV
source and a few environment exports can stay inline. Put genuinely common
patterns in reusable target macros with their owner; avoid wrappers that merely
bind a few fixed attributes.
load("@rules_al//:defs.bzl", "al_config", "al_vault_auth")
al_vault_auth(name = "shared_auth")
al_vault_auth(
name = "component_auth",
extends = ":shared_auth",
approle = "example",
)
al_config(
name = "config",
configs = [
":component_auth",
":shared_auth",
"@rules_al//plugins/vault:config",
],
)
configs combines definitions independently of list order. An atomic target’s
extends selects another atomic target of the same kind. For the same runtime
name, the descendant replaces the complete definition; shared ancestors are
included once. Unrelated definitions with the same kind and name fail analysis.
In the example, both auth targets name default, so the output contains one
auth method using the component AppRole. Command wrappers combine multiple
config targets with the same rules before passing a generated file to AL.
Extensions between differently named injection groups retain both namespaces.
Generated groups carry their explicit parent identity; selected descendant
resources override ancestors independently of map iteration. Identical unrelated
resource definitions coalesce, while differing unrelated definitions fail.
Aggregate references follow normal formatter ordering. Builds never authenticate
or start plugins.
al_config(config = {...}) remains available for small inputs. Its vault_auth,
vault_conn, plugin_configs, plugins and inject sections are dictionaries keyed by
runtime name, with no repeated names inside their values. Entries may use an
explicit extends label to override an inherited definition. Large dictionaries
should be split into targets rather than moved wholesale into another file.
Generated JSON and YAML use the same five name-keyed maps. Map keys own identity;
entry values do not repeat a name. Plugin invocations and injection groups retain
their own named namespaces, and each injection group contains its res map.
Repository components compose //infra:al and have their auth target extend
//tools/al:auth. A standalone consumer can compose
@rules_al//plugins/vault:config to register the Vault provider. Reuse shared
configuration targets instead of copying registrations.
Configuration targets carry plugin executables, their transitive runfiles and
TLS files. An al_binary_run consumer only needs configs = [":config"];
do not repeat those plugins in its data. Other Bazel consumers can place the
configuration target in data to receive the same runtime closure.
args contains ordinary JSON-compatible plugin arguments. argv contains an
executable’s command-line argument list. Plugin arguments support up to 64 nesting levels, including distinct
empty maps and lists and nested null values.
inject declarations contain typed res maps of named resources, independently
of external plugin calls. env and
other resource settings remain objects. Dependencies are ordered lists of
resource names: Last selects the final listed dependency. Injection overrides
use explicit group ancestry. Missing/cyclic dependencies, invalid extension
lineage and ambiguous resource definitions fail before providers or the child start.
Vault connection attributes ca_cert, client_cert and client_key select
files by label. Runtime TLS initialization resolves directory or manifest
runfiles. Absolute paths remain filesystem paths; installed commands without
runfiles resolve relative TLS paths against their working directory. Secret
values belong in runtime injection, not build inputs.
A call can declare substitutions = {"//data:public_file": "@PUBLIC_FILE@"}.
The action reads this explicit public input, trims surrounding whitespace and
JSON-escapes its contents before replacing the marker in argument string
values. This is suitable for public certificate authorities.
al_config compiles to AL JSON. AL loads JSON and YAML; Lua configuration and
the former srcs interface have been removed. All atomic target types provide AlConfigInfo and runtime files.
Command selection
Pass plugin_labels = {"tf": "setup", "pve_login": ""} to AL command wrappers.
Keys select labels; nonempty values match an exact value and an empty value
matches the label’s presence. The wrapper encodes these into AL CLI arguments.
Use run_args only for other AL options and args for the child command.
al_inject, exported through the public API, accepts named res_env, res_file,
res_kv, res_op, res_oidc, res_vault_env, res_vault_ssh and res_process maps. Entries contain
structured type settings and optional deps, vault_auth and vault_conn
metadata. It builds typed resource definitions in Config.inject; it does
not register or select a plugin.
The reserved data entry supplies generic JSON-compatible input separately
from type settings in args. Environment and file templates read it as .Data;
providers receive it in their fetch request. Vault operations use it as the
request body. For example, res_file = {"config": {"value": "{{ .Data.title }}", "data": {"title": "example"}}}.
See the injector API.
Plugin calls default their runtime identity and selected plugin name to the
Bazel target name. Use config_name or plugin when those names must differ.
Injector declarations default their identity the same way in a separate namespace.
In the small dictionary API, the entry key supplies the default plugin name;
generated private fragment names do not become runtime identities.
Resource providers use al_plugin_config(resource_provider = True, ...). The startup response owns the available resource kinds; configuration does not repeat a type list. Built-in-only calls need no provider target.
The small dictionary API accepts inject = {"name": {"resources": {...}}}.
Explicit injected environment exports override plugin startup defaults.
2.2 - Built-in resource injection
Generic resource graphs and invocation-owned resource lifetimes
Configuration
AL evaluates selected inject configuration entries internally. No injector executable or
plugin registration is needed for the built-in env, file and process types.
al_inject is exported through @rules_al//:defs.bzl; its named
res_<type> maps compile into resources with type, args and ordered deps.
Declarations live in typed InjectorCall.res maps, separately from external
plugin calls. Resource keys own identity. Built-in env/file/process settings use generated
protobuf messages; Vault settings remain opaque arguments to their provider.
Each resource can supply JSON-compatible data alongside its type-specific
args. Environment and file templates read local input through .Data;
.Last.Data and .Res[name].Data read dependency results. Data supports nested
objects, lists, nulls and signed integers without rounding. Provider fetches
receive the same input as ResourceFetchRequest.data. File-specific extra
settings and .Extra have been removed.
The engine validates missing/cyclic dependencies before starting providers,
evaluates each selected node once and supplies ordered dependency results to
its fetcher. Last retains the final declared dependency. The root inject map
keeps named groups and their res maps. Explicit target extensions determine
resource override precedence; key order has no effect. Equal unrelated resource
definitions coalesce; conflicting unrelated definitions fail before startup.
Extension lookup traverses ancestor declarations without selecting their resources.
Environment values remain structured settings. Small declarations stay inline;
extract macros only for meaningful reuse or substantial readability gains.
External plugins marked resource_provider = True advertise types through
PluginStartResponse.resource_types at startup and implement ResourceFetch. AL starts
eligible providers for discovery only when selected resources require types beyond
the built-ins. Explicit plugin label/call selection retains its normal startup behavior.
Advertisements must be nonempty and unique across providers and built-ins.
Missing providers, capability collisions and resource failures prevent child
startup. Provider startup must initialize capabilities without fetching secrets;
AL fetches only selected resources through the generic RPC.
Fetch requests carry the resource name, type, opaque arguments and ordered
ResourceResult dependencies. Results carry data, file paths and environment
exports. PluginStart returns PluginStartResponse with an optional
ResourceResult in result; the envelope can gain startup fields independently
of resource output. ResourceFetch returns ResourceResult directly.
Go plugins may return nil, nil or a response without result when startup has
no resource output. An explicitly empty result retains its presence in
PluginClient.StartResponse().GetResult(). Present startup env/files/data
remain available through that result, and environment exports reach the child.
Plugins retain ownership of their startup files through shutdown. Startup data
does not implicitly add dependency nodes to the injection graph.
Data travels as JSON-compatible values; signed integers retain int64 precision.
Diagnostics omit argument/result values. Explicit injection exports override startup exports, including conflicting startup
defaults. Environment-only plugins return their
exports in ResourceResult.Env and need no resource service. Invalid capability advertisements roll back startup before the child runs.
AL keeps resources alive until the child finishes, including its graceful
cancellation. Shutdown stops built-in consumer processes, removes their files,
then stops provider processes. Providers drain requests before releasing their
own tokens/files. Failed startup and cancellation roll back attempted resources.
Temporary files use 0600; SSH directories owned by the Vault provider use 0700.
Deletion is unlinking, not secure erasure; forced host/process termination can
prevent cleanup.
The Vault provider supplies kv, op, oidc,
vault_env and vault_ssh. Core injection imports no Vault provider schema or
handler implementation. No global provider registration or live deployment is
performed by building configuration targets.
2.3 - Docs
2.3.1 - Al
Repository command runner and Bazel configuration rules
AL is a command runner that prepares credentials and environment variables
through plugins, runs your command, and cleans up afterward. Its Bazel rules
package commands with their configuration and required plugins.
Repository tools are built through their ordinary Bazel targets. Use explicit
install targets, such as //tools/al:install, for standalone host
commands. AL does not cache, build or install repository tool executables.
The former al tool command and tool declarations have been removed.
Repository agent skills are written by bazel run //.agents:write_skills
and checked by //.agents:write_skills_test.
Links
2.3.1.1 - Command and plugin lifecycle
Startup, shutdown, and secret cleanup guarantees
Build merges AL configs and propagates plugin runfiles into the command’s
runfiles. The Runfiles subgraph contains the merged AL configuration, plugin
runfiles and command executable; source AL configs remain build inputs. AL reads the merged configuration,
starts plugin subprocesses and communicates with them using gRPC over stdio.
Plugins return environment values, file paths and data through that connection,
as shown by the dashed Resources edge. AL runs the command with its
prepared environment. Plugins connect to external services. Build arrows show configuration
dependencies; Run arrows show AL’s interactions with the built outputs and plugins.


The Mermaid source is authoritative. This repository renders and
packages its light/dark SVGs through //tools/al:run_lifecycle_svg.
al run starts selected plugins, passes their environment to a command, and
keeps plugin resources available until that command exits. On cancellation it
asks the command to terminate and waits up to ten seconds before killing it.
Plugin shutdown then drains requests, releases resources in reverse registration
order, and waits for plugin exit. Startup failure cancels sibling starts and
rolls back partially initialized resources. Cleanup errors fail the invocation.
A standalone installation can run ordinary commands and explicitly selected
absolute plugin executables without Bazel runfiles. Selected relative plugin
identifiers still require runfiles. Available declared or executable-adjacent
runfiles are passed to children; an invalid declared runtime context fails
instead of silently falling back to standalone execution.
Selected plugins may export the same environment name only when their values
agree. Different values fail before the child starts and trigger plugin cleanup.
The diagnostic names the key and plugins in a deterministic order without
printing the values. Explicit injection exports override plugin startup defaults,
including otherwise conflicting startup values. Agreed plugin exports can
override inherited environment values intentionally.
--stdout and --stderr create output files when absent and truncate existing
files before execution. New files use owner-only permissions; existing file
permissions and ordinary symlink-following behavior are retained. --stdin
opens an existing readable file. AL closes its own file descriptors after the
child and plugins stop, while ordinary inherited streams remain borrowed.
Output preparation is not transactional: later startup failure does not restore
previous output contents.
The injector creates secret files with owner-only permissions and removes them
after consumers stop. Vault stores revoke AppRole tokens they issue; failed
AppRole login attempts destroy their unused single-use SecretID. The role’s
bootstrap policy must permit secret-id-accessor/destroy, as declared by
projects/tf_modules/vault_approle. The user’s existing token-helper credential
is never erased or revoked. Secret inputs and remote response bodies are omitted
from diagnostic messages. OIDC authorization uses the configured Vault HTTPS
origin and TLS transport, rejecting alternate origins and redirects.
Explicit config dumps still contain the requested configuration; file outputs
use owner-only permissions and truncate previous contents.
no_auth prevents AL’s Vault client from loading credentials. For environment
injection it clears inherited VAULT_TOKEN; it does not sandbox the command or
prevent a command from independently reading the user’s token helper. Plugins
and invoked commands remain trusted programs with the user’s filesystem access.
Cleanup is observable best effort, not secure erasure. Memory copies are not
zeroized. Forced termination, host failure, unresponsive cleanup code, or an
unavailable service can prevent deletion or revocation. Subprocess signaling
targets direct children, not arbitrary descendants. Credential expiry remains
a fallback; service-specific logout requirements are documented with each plugin.
2.3.2 - AL product description
Commands, observable behavior, interruption, and recovery
AL product description
AL gives a repository operator one command for inspecting configuration, running
commands with selected plugins, selecting tests affected by Git changes,
choosing a shared source version,
publishing individual project releases, extracting and activating websites, and
delivering a branch for review.
The operator chooses each project and each publication step. No CI scheduler or
automatic weekly release is part of this surface.
Purpose
This is a source-linked description of the command-line experience: what an
invocation reads, changes, reports, and leaves behind after interruption. It is
for operators and people changing AL. The executable and its tests remain the
source of behavior; these documents describe the revisions cited by each feature,
not an additional implementation contract. The project README
owns build API documentation and operator recipes.
Conventions
Use the glossary consistently. Describe observable behavior in
plain language. Put mechanisms in a Technical note only when they change what
an operator should expect. Link to the owning foundation instead of copying its
rules. A source footer identifies the code examined; it does not claim a manual
runtime pass. Suspected defects belong in bug triage.
The work to be done
Document template
Features use eight sections: Summary; The simple case; The interaction, event by
event; Modifiers; Cancel and interrupt; Interactions with other systems; Edge
cases; Open questions and verification. Foundations may omit inapplicable phases.
The interaction is one invocation. Its phases are Invoke, Exits
immediately, Begins running, While running, and Finishes. Each feature
includes a Mermaid state diagram for repository viewers that render Markdown.
Every modifier table uses these rows, in order: Arguments and flags,
Environment and configuration, Terminal and streams. Columns distinguish
behavior from output. Arguments do not change after invocation.
Every interrupt table uses these rows, in order: Ctrl+C once or twice,
SIGTERM, Terminal closed (SIGHUP), Input or output pipe closes,
Network lost, Disk full or file inaccessible, Required state changes,
Concurrent invocation, Forced kill. Columns are Before work and
During work. Unknown behavior is identified, never inferred as rollback.
Cross-cutting concerns appear in this order: Configuration, Output,
Permissions, Concurrency, Persistence and recovery, Network.
Method
Read the owning command, state handling, and behavior tests; draft the pilot,
foundations, and release publication first; then draft other features. Check
terminology, links, table coverage, and source footers across the set. Run safe
local invocations and retain their outputs. The checklists distinguish those
observations from fixture coverage and from unperformed terminal or live checks.
Verification
Verification owns setup, results, and limitations.
Coverage remains drafted after a scripted pass; manual observation is required
before marking a document verified. No release destination is changed to
verify these documents.
Scope decisions
- Surface: Linux AL CLI in this repository, with Bash invocation, defaults
unless flags are stated. Both an installed binary and Bazel-run commands are
distinguished where their behavior differs. No user configuration is assumed.
- Owner and integration: AL lives in
projects/al; its Bzlmod name remains
rules_al. Repository-specific configuration supplies its integration inputs
and its validation policy. The observations here cover this
repository and its isolated fixtures; moving the owner does not broaden that
evidence into a verification of every workflow in another repository. - Source: use the feature’s footer to select its source revision.
- Runtime: source-built AL installed into ignored task scratch; behavior
tests exercise isolated repositories, plugins, and SSH destinations.
- Placement: maintain these documents in the AL project and select the
owner-local change that covers the requested work.
- Excluded: Go/Starlark API reference, third-party programs’ own behavior,
actual credential values, live deployments, and infrastructure synchronization.
Relevant limitations and boundaries are described where the operator meets them.
- Completeness: all seven command families are covered, including the nested
release website extraction and activation commands. Detailed delivery
flags remain in its existing command reference; this set describes their
user-visible lifecycle and state handoffs.
Source revisions
The initial description follows the AL implementation in alwaldend/src
commit 1b48b459ad3623213f42f6cf9eac351083eb2dbc. Its AL implementation
matches the original candidate 7cd4714139984bf4f9b2ae1de9189470b336e12e.
Features that use this baseline link here. A feature updated against a later
revision records it in its own footer, as in Inspect configuration.
The verification records retain the source revisions
and executable identities observed during earlier runs.
Structure
README.md: purpose, conventions, scope, and coverage.goal.md: drafting and continuation instructions.glossary.md: shared vocabulary.AGENTS.md, CLAUDE.md: local documentation entry points.BUILD.bazel: documentation packaging.foundations/invocation.md: command entry, output, and interruption.foundations/state.md: local, source, publication, and receipt state.releases/bundle.md: pilot; generate an inspectable project bundle.releases/publication.md: artifact planning, inspection, upload and deletion;
website extraction, activation, dry runs, and recovery.releases/versioning.md: source versions, refs, and stamped builds.delivery/workflow.md: candidate preparation through publication and review.commands/configuration.md: inspect and merge explicit configuration.commands/run.md: run a child with selected plugins and cleanup.commands/bazel-doctor.md: select affected tests and inspect local setup.verification/README.md: protocol, evidence, and pass limits.verification/foundations.md: foundation checklists.verification/releases.md: version, bundle, and publication checklists.verification/delivery.md: delivery checklist.verification/commands.md: configuration, execution, and diagnostic checklists.bug-triage.md: deduplicated suspected defects and decisions.
Coverage
| Document | Status |
|---|
| glossary.md | drafted |
| foundations/invocation.md | drafted |
| foundations/state.md | drafted |
| releases/bundle.md | drafted |
| releases/publication.md | drafted |
| releases/versioning.md | drafted |
| delivery/workflow.md | drafted |
| commands/configuration.md | drafted |
| commands/run.md | drafted |
| commands/bazel-doctor.md | drafted |
| verification/README.md | drafted |
| verification/foundations.md | drafted |
| verification/releases.md | drafted |
| verification/delivery.md | drafted |
| verification/commands.md | drafted |
| bug-triage.md | drafted |
Reference
Paths below are relative to projects/al:
cmd/al/main.go, internal/cli: startup, streams, configuration, child execution.pkg/al, pkg/al_plugin, pkg/lifecycle: configuration and plugin lifetime.internal/versioncmd, internal/versioning: calendar and Git operations.internal/release: bundle creation and SSH release transitions.internal/delivery: candidate, publication, and review guards.internal/bazelcmd: affected-test selection and local AL/Bazel diagnostics.cmd/al/lifecycle_e2e_test.go, cmd/al/run_e2e_test.go,
internal/release/lifecycle_test.go, internal/release/observation_test.go,
internal/versioning/publication_integration_test.go,
internal/delivery/delivery_integration_test.go: behavior fixtures.- Root
tools/al/test/command, tools/al/test/contract, and
infra/download/test/sync: plugin and real SSH/Ansible fixtures.
2.3.2.1 -
Read README.md, then goal.md. The coverage table in README.md is the work list.
2.3.2.2 -
Read @AGENTS.md.
2.3.2.3 - AL defect triage
These entries retain the original findings and record their corrections. Current
behavior belongs to the feature documents; historical reproductions below must
not be read as current expectations. No external issues have been filed. Source
paths below are relative to projects/al. The verification protocol
separates baseline observations from later fixture passes.
| ID | Severity | Behavior | Decision | Status |
|---|
| B-01 | medium | Installed run cannot start without Bazel runfiles | fixed | C2 installed-command fixture passes |
| B-02 | medium | Output overrides preserve stale trailing bytes | fixed | C2 stream-file fixture passes |
| B-03 | medium | Conflicting plugin environment exports have no defined winner | fixed | C2 plugin-environment fixture passes |
| B-04 | medium | Direct delivery rebase pushes before validation | fixed | R1 local-rebase fixtures pass |
| B-05 | medium | Selected release base is refused after unrelated trunk advances | fixed | R2 selected-base fixtures pass |
B-01: Installed run requires runfiles
- Raised by: Run.
- Where: A user installs the standalone executable and invokes
al run -- /usr/bin/true, without configuration or plugins. - Original behavior: AL exited 1 with a runfiles discovery error before starting the
child. The same invocation can run with an explicitly supplied empty runfiles
directory, demonstrating that no actual plugin runtime files were needed here.
- Expected: A standalone command with no selected plugin should execute, or
the installation should supply/document its required runtime layout.
- Baseline reproduction: 1. Use the original task-local installed binary. 2. Unset
RUNFILES_DIR
and RUNFILES_MANIFEST_FILE. 3. Run the command above. 4. Observe exit 1 and
runfiles: no runfiles found. Do not confuse a Bazel-run invocation with this case. - Original cause:
internal/cli/run.go:44 always prepares runfiles environment;
pkg/al/command.go:40 requires discovery. The plugin manager also constructs a
runfiles resolver at pkg/al_plugin/manager.go:37. Installation copies only AL. - Resolution: Missing optional runfiles no longer prevent standalone child
execution. Absolute plugin paths work without runfiles; selected relative
identifiers still require them. Invalid declared runfiles remain errors.
- History: C1
run-installed-without-runfiles reproduced the failure on
2026-11-02 against the baseline identified in the verification protocol. - Status: Fixed; C2
TestRunStandaloneCLI passes all eight isolated cases.
No manual terminal pass or live credential use is claimed.
B-02: Output redirection retains old bytes
- Raised by: Run.
- Where:
al run --stdout OUTPUT -- COMMAND, or the corresponding stderr flag. - Original behavior: Existing output was opened at offset zero without truncation.
A child writing
new into previous-content leaves newvious-content.
Missing output files are refused, and existing permissions are retained. - Expected: Shell-like replacement would create/truncate output; intentional
in-place writes need a clear contract because trailing bytes look like child output.
- Baseline reproduction: 1. In isolated scratch create
OUTPUT containing
previous-content. 2. Supply the empty runfiles fixture to bypass B-01. 3. Run al run --stdout OUTPUT -- /usr/bin/printf new. 4. Read the whole file. - Original cause:
internal/cli/run.go:108 and :117 used write-only opening without
create/truncate flags. This differs from config dump’s private truncated output. - Resolution: Both output overrides create missing files or truncate existing
ones. New files use mode 0600 subject to the process’s permission mask; existing
permissions remain unchanged. Later startup failure does not restore old bytes.
- History: C1
run-existing-output and run-missing-output reproduced the
failure on 2026-11-02; the existing file retained mode 0644. - Status: Fixed; C2
TestRunStreamFiles passes the missing/existing output
cases for stdout and stderr. Retained artifacts show new files at 0600 and
existing files at 0644. The input file is unchanged. No real secrets were used.
B-03: Conflicting plugin environment exports
- Raised by: Run.
- Where: Two selected plugins export the same environment variable.
- Original behavior: The child environment was assembled from map iteration, so
conflicting exports have no documented stable precedence.
- Expected: Reject duplicates or define a deterministic precedence that the
operator can inspect.
- Baseline reproduction: 1. Prepare two synthetic plugins exporting different values for
the same key. 2. Select both. 3. Invoke a child that prints only that synthetic
key repeatedly. 4. Record values and order. Repeated agreement alone cannot
prove ordering is guaranteed.
- Original cause:
pkg/al_plugin/manager.go:64 traversed the configured plugin map
while collecting environment exports. - Resolution: Equal selected exports are accepted once. Different values for
one key fail before child launch, with a deterministic diagnostic naming the
key and plugin names but omitting values. Started plugins proceed through
cleanup. Selected exports can still override inherited environment values.
- History: The original description recorded a source-derived suspicion;
its initial 30-invocation pass did not exercise conflicting plugins. The later
failing-before fixture artifacts are retained separately from C1.
- Status: Fixed; C2
TestRunPluginEnvironment passes equal-value and both
conflict-order cases, including child refusal, omitted values, and plugin
shutdown markers. This is synthetic fixture evidence, not a live-provider pass.
B-04: Direct delivery rebase pushes before validation
- Raised by: Delivery.
- Where: An operator runs
al delivery rebase on an eligible branch after its base advances. - Original behavior: The command rebased and pushed with an exact ref lease
before the operator could check the changed candidate. The then-current
receipt-bound publication workflow instead stopped for revalidation.
- Expected: Replaying source locally must leave publication to the separate
preparation, validation, and explicit publication workflow.
- Baseline reproduction: 1. Use the former
TestRebaseReplaysAdvancedBaseAndLeasePushes in the isolated
delivery fixture. 2. Advance the base. 3. Run direct rebase. 4. Observe the remote
feature head and pushed: true without a validation invocation. - Original cause:
internal/delivery/rebase.go:140 called the guarded push directly. - Resolution: Direct rebase changes the local candidate only. Its report
retains the observed remote head and lease, says
pushed: false, and directs
preparation, ordinary checks, and explicit publication after a replay.
Receipt-bound publication now reports checks_required after a rebase;
the operator runs checks and then publishes with the updated preparation receipt. - History: Observed during the task’s original authorized rebase;
retained report
out/unify-release-versioning/rebase-description/rebase.json.
Final delivery validation is separate evidence, not a claim that rebase ran it. - Status: Fixed; R1
TestRebasePreservesRemoteUntilPublication checks existing
and absent remote refs. TestRebaseAlreadyBasedPreservesRemote checks the no-op
case, and TestRebaseRequiresCleanWorktree checks preserved dirty inputs.
The next_action wording is source-derived and remains an unrun checklist row.
- Raised by: The isolated selected-base fixture during the project move.
- Original behavior: Delivery inspection compared the selected release base
with local
origin/master. Advancing unrelated trunk marked that selected base
stale and refused both an explicitly selected base and one supplied by a PR. - Expected: Ancestry and rebase decisions use the selected base’s fresh ref.
- Original cause: The additional
origin/master comparison in
internal/delivery/delivery.go applied independently of the selected base. - History: R2 failing-before
selected-base-false.json and
selected-base-true.json report base_stale: true and a refusal for the
unchanged release base. - Resolution and status: Fixed.
TestDeliveryInspectionUsesSelectedBase
passes both cases: unrelated advancement leaves the selected base usable,
while selected-base advancement sets needs_rebase. Local HEAD is preserved.
The R2 protocol record
identifies the retained before/after evidence; no manual or live-forge pass is claimed.
Verification boundary
The observations use synthetic values and task-private files. No live release,
credential, or infrastructure configuration was changed. Other open questions
in feature documents are coverage gaps unless evidence establishes a defect.
2.3.2.4 - Commands
2.3.2.4.1 - Inspect configuration
Summary
al config dump reads explicitly selected configuration files and shows their
merged contents as JSON. It can write that representation to a private file.
Inspection does not start plugins or prove that a selected plugin can run.
The simple case
Run al config dump --config /absolute/path/config.json. AL prints the merged
configuration, then exits. Repeat --config to include more files in order.
Without any files, the result is an empty JSON object followed by a newline.
Use --out /absolute/path/dump.json to write a file instead. Read the file after
successful completion. The output can contain sensitive configuration values;
inspection does not redact the requested representation.
The interaction, event by event
Invoke
The operator supplies each file explicitly. AL does not search for a default
configuration or inherit al run flags. Accepted filename extensions are .json
and .yaml; .yml is not an alias. Lua inputs are rejected. -c and -o abbreviate --config
and --out. Relative paths use the invocation’s working directory.
Help describes the flags. A missing file, unsupported extension, or invalid
configuration fails before the output file is opened. The diagnostic identifies
the file and failure stage without echoing invalid configuration values.
Begins running
AL reads files in their supplied order. List entries accumulate in that order.
For example, plugins supplied in three files remain three entries in the dump;
dumping does not resolve duplicate plugin names into one selected plugin.
Use --substitution MARKER=/absolute/path/public-file to replace a marker
with the trimmed, JSON-escaped contents of a public build input before parsing.
Loading declarative files does not start the plugin definitions they contribute.
While running
AL collects the complete representation before opening a requested output file.
There is no progress display or interactive editing phase. Once output writing
starts, an existing file is restricted to owner access and truncated. The write
does not use a separate replacement file; a failure can leave partial contents.
Finishes
Success produces indented JSON and a final newline, either on stdout or at the
selected path. File output has mode 0600, including when the file previously
had broader permissions. Failure to restrict, truncate, or write the file fails
the invocation. No plugin resources remain to clean up because none were started.
stateDiagram-v2
[*] --> ReadConfigurations: invoke
ReadConfigurations --> Refused: unreadable or invalid file
ReadConfigurations --> WriteRepresentation: all files loaded
WriteRepresentation --> OutputReady: write succeeds
WriteRepresentation --> InspectOutput: write interrupted or fails
OutputReady --> [*]: returnModifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | Repeated configuration paths determine merge order; the output flag chooses a file instead of stdout. | The selected configuration is printed as indented JSON, or stdout stays empty when a file is selected. |
| Environment and configuration | Only explicit files are loaded; explicit public-file substitutions are applied before parsing. | Substituted public file values appear in the requested dump. |
| Terminal and streams | No TTY or stdin is required for declarative files. | JSON uses stdout unless an output path is supplied; diagnostics use stderr. |
Arguments remain fixed during the invocation. Editing a source file while it is
being read is not an interactive configuration update.
Cancel and interrupt
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses the invocation signal model; a cancelled load can fail. | Cancellation is checked before each configuration read; file reads and output writes do not promise immediate interruption. |
| SIGTERM | Requests cancellation before another configuration load. | There is no automatic restoration of an output already truncated. |
| Terminal closed (SIGHUP) | No special AL recovery. | An output already being written can remain partial. |
| Input or output pipe closes | Declarative configuration comes from named files, not stdin. | A closed output stream can stop the write; no complete JSON result is promised. |
| Network lost | No effect for ordinary local JSON or YAML inputs. | No effect for local inputs and substitution files. |
| Disk full or file inaccessible | Required input read fails before output is opened. | Output permission, truncation, or write failure is reported; existing contents may already be changed. |
| Required state changes | Each path is read when its turn arrives. | Concurrent edits have no whole-input snapshot guarantee. |
| Concurrent invocation | Independent input/output selections can run separately. | Shared output files have no serialization guarantee; use a different path. |
| Forced kill | No completed dump is implied. | Partial output can remain; rerun into a fresh path after inspecting it. |
After interruption, inspect the selected output. Neither a file’s existence nor
its private permissions establishes that the JSON is complete.
Interactions with other systems
Configuration. This command owns the merged representation, not plugin
selection or startup. See run for execution.
Output. Dump contents are intentionally visible to the chosen stream or
file. The invocation foundation owns stream names.
Permissions. Inputs must be readable; the output directory must permit
creation, and existing output files must permit restriction and writing.
Concurrency. There is no lock binding all input files or protecting shared
dump paths from other invocations.
Persistence and recovery. A successful file dump replaces its previous
contents directly. There is no backup, receipt, or automatic rollback.
Network. Declarative local inputs and public substitution files need no service.
Edge cases
- An empty configuration list is valid and prints
{}. - Duplicate plugin names can appear in a dump; run
rejects them when constructing its execution configuration.
- Changing permissions on an existing output does not validate its contents.
- Reading and writing the same configuration path is possible because loading
finishes first, but the output format is JSON regardless of the path’s suffix.
- Lua is no longer evaluated; unsupported formats fail before output is opened.
Open questions and verification
- Sources: command flags,
loading and output, and
output/error fixtures.
- Earlier scripted observations covered empty input, JSON/YAML/Lua merge order, private
truncated output, and redacted invalid-input diagnostics. They are not a manual
verification pass. The native-configuration-targets change removes Lua and
verifies generated JSON through the independent consumer fixture.
- Cancellation during a file write, broken pipes, and simultaneous output writers
remain unobserved. No atomic-output guarantee is inferred.
- Checklist: configuration.
Configuration source revision in alwaldend/src after the
declarative configuration migration
is d0ab69ec85dd9ad324c3a07d86c4bce8adbce72f. The earlier C1 observations
retain their original executable and source identities.
2.3.2.4.2 - Run a command with plugins
Summary
al run prepares selected plugins, passes their environment to a child command,
and keeps their resources available until that command stops. Cleanup then runs
before AL returns. A standalone installation can run a child without Bazel
runfiles when no selected plugin needs them.
The simple case
Run al run -- /usr/bin/true for a child without plugins, or use an existing
Bazel-packaged AL command with its configuration and selected plugin labels.
Its command runs after the selected helpers finish starting.
The child reads and writes the operator’s ordinary streams. When the child
finishes, AL waits for cleanup and returns to the shell.
The direct form is al run --config CONFIG --plugin_label KEY=VALUE -- COMMAND ARGUMENTS. The -- separator keeps child options separate from AL options.
Configuration and label flags can be repeated. Plugins are selected explicitly;
supplying a configuration alone does not select all its plugins.
The interaction, event by event
Invoke
AL loads the explicit files described by configuration,
discovers any available runfiles, and opens selected stream overrides. It inherits the
operator’s environment. The child is an executable plus arguments, not a shell
expression; shell expansion requires choosing a shell as the child.
An absent runfiles context is allowed. Explicitly configured runfiles must be
valid; an invalid manifest or directory is not silently ignored. A selected
plugin with an absolute executable path needs no runfiles. A selected relative
plugin identifier needs a runfiles context; it is not resolved against PATH.
--stdin opens an existing input file. --stdout and --stderr create missing
output files or truncate existing ones before plugin startup. New files are
created with owner read/write permissions; existing permissions are retained.
Help prints usage. A missing command, unreadable configuration, invalid declared
runfiles, unavailable selected plugin executable, inaccessible stream file,
duplicate plugin name, or invalid selected plugin/call prevents the child from
starting. An unselected plugin does not require its executable or runfiles.
Begins running
A label matches a plugin or call when its key exists and its optional value
matches. A bare key accepts any value. Any matching supplied label selects the
entry; the labels are not an all-must-match filter. Selecting a call also starts
its owning plugin. No supplied labels means no selected plugins or calls.
AL starts the selected plugins and reports their startup on stderr. It combines
their returned environment before launching the child. Equal values for the same
key are accepted once. Different values for the same key refuse child execution;
the diagnostic names the key and plugins in a stable order without printing their
exported values. Selected exports can override inherited environment values.
Startup failure prevents the child, cancels sibling startup, and attempts cleanup
of partial resources. An environment conflict after startup also prevents the
child and proceeds through cleanup of the started plugins.
The lifecycle reference owns the detailed guarantees.
While running
The child uses its assigned streams and can interact with its own services.
Plugin resources stay available while it runs. AL does not make the child a
sandbox or monitor arbitrary descendants. A child needing credentials can use
its inherited access independently of AL’s plugin configuration.
Cancellation asks the child to terminate before releasing its resources. The
lifecycle reference owns the grace period and eventual forced stop. Successful
child shutdown does not turn cancellation into a successful invocation.
Finishes
AL waits for the child, then shuts down plugins and closes stream files it
opened. A child failure is reported and its positive exit status can be
preserved. Cleanup failure also fails the invocation. Child writes are not
rolled back. Forced termination can prevent cleanup entirely.
stateDiagram-v2
[*] --> Prepare: invoke
Prepare --> Refused: invalid setup
Prepare --> StartPlugins: setup ready
StartPlugins --> Cleanup: startup fails
StartPlugins --> CheckExports: plugins ready
CheckExports --> Cleanup: conflicting exports
CheckExports --> RunChild: exports accepted
RunChild --> StopChild: cancellation
StopChild --> Cleanup: child stops
RunChild --> Cleanup: child exits
Cleanup --> ReturnCommandStatus: cleanup completes
Cleanup --> ReturnFailure: cleanup reports failure
ReturnCommandStatus --> [*]
ReturnFailure --> [*]Modifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | Configuration and label flags choose helpers; arguments after -- choose the child and its arguments. | Child output follows the selected program; AL reports startup and failures on stderr. |
| Environment and configuration | Selected exports override inherited values; conflicting selected exports prevent the child. Runfiles are required only for selected relative plugin identifiers. | Startup and conflict diagnostics identify keys and plugins without their exported values; the child controls its own disclosure. |
| Terminal and streams | --stdin opens an existing file; --stdout and --stderr create or truncate files instead of inheriting those streams. | Child output replaces the selected files’ contents; ordinary inherited streams remain unchanged. |
Flags are fixed before startup. An already running child does not reload a
configuration file when the operator edits it.
Cancel and interrupt
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses the invocation signal model; cancellation is checked before child launch. | Requests child shutdown, then plugin cleanup; a second Ctrl+C has no guaranteed escalation. |
| SIGTERM | Cancels setup and prevents a subsequent child launch. | Requests child shutdown while plugin resources remain available, then cleanup. |
| Terminal closed (SIGHUP) | No special AL recovery. | Cleanup is not guaranteed; child/plugin state needs inspection. |
| Input or output pipe closes | Streams are inherited unless files override them. | The child observes EOF or stream failure; AL cleans up when the child exits, without undoing its work. |
| Network lost | Plugin startup can fail; a command without network-dependent setup is unaffected. | Child/plugin behavior determines the failure; cleanup may itself fail when a service is unreachable. |
| Disk full or file inaccessible | A required configuration, executable, or stream file can prevent startup. | Child writes or cleanup can fail; earlier files and external changes remain. |
| Required state changes | Required files and plugins are checked as setup reaches them. | Changes to external files/services are the child’s or plugin’s concern; AL does not restore a snapshot. |
| Concurrent invocation | Each invocation prepares its own selected resources. | Shared output paths and external resources have no command-wide locking guarantee. |
| Forced kill | No completed child execution is implied. | Cleanup cannot run; resources and child processes can remain. |
Inspect the child’s effects and plugin resources after failure. An invocation
does not produce a general receipt describing those effects.
Interactions with other systems
Configuration. Configuration loading happens before
selection. Duplicate plugin names are rejected even if no label selects them.
Output. Default streams belong to the operator. AL closes only files it
opened. Output overrides replace previous contents. Opening those files happens
before plugin validation and startup, so a later setup failure can leave an
empty or truncated file even though the child never ran.
Permissions. Commands and plugins retain the operator’s access. New output
files use mode 0600 subject to the process’s permission mask. Existing output-file
permissions are not tightened by stream redirection. Credential
resource permissions and cleanup belong to the lifecycle reference.
Concurrency. Selected plugins start concurrently. Their completion order
does not choose a winner for conflicting exports: different values are refused
before child launch. Shared output paths have no command-wide lock.
Persistence and recovery. AL attempts cleanup after ordinary success,
failure, and cancellation. This is not secure erasure or rollback of the child’s
work. Recovery depends on the resources and child command selected.
Network. AL’s selected helpers and the child can contact services. There is
no universal offline mode or retry policy for those operations.
Edge cases
- Bare
--plugin_label KEY accepts any configured value for that key. - Repeating a selector key keeps its last supplied selector value.
- A selected call can start a plugin whose own labels did not match.
- An invalid unselected plugin executable is not started, although duplicate
plugin names still make configuration invalid for execution.
- Relative plugin identifiers require runfiles even when an executable of the
same name is available on PATH. Absolute plugin paths work without that context.
- Identical selected exports are accepted, and unselected plugins do not
participate in export conflict checks.
- Unlike configuration dump output, redirection
retains an existing output file’s permissions. Both replace previous contents.
Open questions and verification
- Sources: command execution,
selection and exports,
plugin startup, and
lifetime handling.
- The existing root fixture
tools/al/test/command/command_test.go covers
synthetic secret lifetime, startup rollback, and cancellation. This description
did not perform a new manual plugin or terminal pass. cmd/al/run_e2e_test.go exercises installed execution, runfiles requirements,
stream-file replacement, and equal or conflicting plugin exports using copied
executables and synthetic plugins. The verification protocol
distinguishes these later fixtures from the original observations.- Historical installed-execution and stale-output failures remain in
triage; they do not describe the corrected behavior above.
- Stream-file failure and interruption can leave changed contents. Terminal loss,
repeated signals, and shared-path races still need their dedicated checks.
- Checklist: command execution.
Source revision is the AL documentation baseline.
2.3.2.4.3 - Select affected tests and inspect local diagnostics
Summary
al bazel test selects tests affected by Git changes against an explicit base.
It can preview that selection or run the selected tests. al doctor prints
local diagnostic JSON without launching Bazel. It describes
selected files and executable identity; it does not prove that a subsequent
build will succeed or that a host executable matches its declared pin.
Ordinary builds and tests remain available through bazel, with setup in the
Bazel reference.
The simple case
Run al bazel test --base master --dry-run from a workspace to inspect its
affected-test selection. Run without --dry-run to execute that selection.
Append a target pattern such as //projects/example/... to limit the test scope;
the default is //....
Run al doctor --workspace-root /absolute/workspace --task-scratch out/task/run to inspect local setup. The JSON identifies the running AL
executable, declared Bazel pin, platform, configured rc-file inventory,
built-binary comparison when available, and scratch-path classification.
No build or repair follows.
For a different workspace layout, select --bazelisk-config PATH and
--source-binary PATH; repeat --rc-file PATH to describe its rc inventory.
Include the absolute path of a user rc file explicitly when it matters to
the report. Doctor does not discover that file automatically.
The interaction, event by event
Invoke
The selector requires --base REF and absolute target patterns. It compares the
current work against the unique Git merge base, including committed changes,
staged edits, working-tree edits, and nonignored untracked paths.
--workspace PATH chooses a Bazel workspace, resolving relative paths from the
current directory. Otherwise
discovery starts from BUILD_WORKSPACE_DIRECTORY when set or the current
directory and finds the nearest Bazel workspace root. Selection belongs to
that workspace, independently of delivery preparation and receipts.
The operator chooses a workspace and optional input/scratch paths. Doctor
defaults to the current directory, reads .bazeliskrc, and reports .bazelrc
as its default rc inventory. Relative pin, source-binary, rc-file, and scratch
inputs resolve against the selected workspace root. Its options use separate
values, as shown in help.
The selector refuses a missing or invalid base or workspace, including a base
without one merge base with HEAD. A failed Bazel query fails selection without
printing a selection report or running tests; partial query output is not
accepted as a complete set. It accepts its selector options and target patterns, not arbitrary
Bazel commands or build/test option forwarding.
Help prints usage without gathering a report. Unknown options, missing option
values, unreadable required files, missing Bazel on PATH, or missing Bazelisk
pin fields fail the report. Doctor does not search upward for a different
workspace. Explicitly empty pin-file, source-binary, or rc-file values are
refused.
Begins running
Bazel queries identify changed source inputs, their reverse dependencies, and
tests inside the requested scope. Deleted, unknown, configuration, or
outside-workspace paths widen selection to the full scope when a narrower set
cannot be established.
Changes in other nested workspaces require their own selected-workspace checks.
Wildcard scopes exclude root targets with the literal manual tag before
expanding test suites. An explicitly named test or suite remains eligible,
and an eligible suite retains its listed members, including manual-tagged
members. Bazel’s configured test filters can further filter the selection.
AL reads local identity and the selected pin file, and resolves bazel from
PATH. A missing selected built binary makes the source comparison unavailable;
it does not prove that the installed binary is current. The report does not
execute Bazel to check its version or ask which rc files were actually loaded.
--source-binary selects the comparison file; otherwise the conventional path
from the diagnostic reference applies.
Successful comparison reports the resolved absolute path. Explicit --rc-file
values replace the default inventory and appear relative to the workspace when
possible. Doctor reports those declarations without reading or validating the
rc files, and does not claim that an agent profile is active.
While running
The selector’s dry run performs selection but skips tests. An unchanged
comparison needs no Bazel queries. Normal
execution runs the selected tests through Bazel with its usual configuration
and cache behavior. Narrowing selection excludes tests and work needed only by
them, so missing or evicted unrelated cache entries do not request unnecessary
rebuilds or reruns. The query itself still loads the requested graph. No measured
performance improvement is claimed.
Doctor collects one bounded report. It does not dump the environment, create
the selected scratch directory, or change an installation. Scratch
classification checks the path’s shape, not whether the directory exists,
is writable, or is isolated from other users.
Finishes
The selector prints one JSON report before test execution. The
Bazel reference owns its fields.
Query diagnostics and all test output go to stderr, leaving stdout as the
selection report. Test failures return nonzero even though that report already
exists. No changes or no selected tests succeeds without invoking tests.
A completed test invocation covers only the selected scope. It does not create a
delivery receipt, publish source, or prove that every affected workspace was
checked.
Doctor prints JSON on stdout and returns. An unavailable source comparison or
conflicting scratch path is a report field and does not itself make doctor
exit nonzero. Reading failures prevent the complete report and produce a
diagnostic instead.
stateDiagram-v2
[*] --> Changes: compare with the Git base
Changes --> Selection: query scoped dependencies
Changes --> NoTests: no changes
Selection --> Preview: dry run
Selection --> NoTests: empty selection
Selection --> Tests: run selected tests
Preview --> [*]
Tests --> [*]: Bazel completes
NoTests --> [*]stateDiagram-v2
[*] --> ReadLocalState: al doctor
ReadLocalState --> ReportFailed: required read fails
ReadLocalState --> ReportReady: local observations collected
ReportReady --> [*]: print JSONModifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | Selector flags choose the base, workspace, scope, and dry run; doctor paths choose diagnostic inputs. | The selector reports its selection; doctor describes the selected inputs. |
| Environment and configuration | PATH selects Bazel; queries and tests use its configuration. Doctor reads the selected pin file without launching Bazel. | Selection reflects the current dependency graph; doctor reports declared identity and rc inventory without claiming effective options. |
| Terminal and streams | Neither selection nor doctor requires a confirmation prompt. | Selection and doctor reports use stdout; query diagnostics and test output use stderr. |
Flags remain fixed. Neither command holds an immutable snapshot across all its
Git, workspace, or diagnostic reads.
Cancel and interrupt
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses the invocation signal model. | The selector cancels its active Git/Bazel client; doctor may finish local reads. |
| SIGTERM | No completed selection, tests, or report is implied. | The selector cancels its active client; neither command rolls back state. |
| Terminal closed (SIGHUP) | No special AL recovery. | Output can stop before completion; inspect any running Bazel work. |
| Input or output pipe closes | Doctor does not read stdin; the selector forwards stdin to its test invocation. | Selection/report writing or test output can fail after earlier work. |
| Network lost | Local Git and diagnostic reads remain local. | Query/test services can fail; doctor remains local. |
| Disk full or file inaccessible | Missing inputs or required executables can fail setup. | Query/test outputs or report writing can fail; no complete result is implied. |
| Required state changes | Current PATH, Git refs, and selected workspace determine setup. | Queries and local reads have no shared immutable snapshot. |
| Concurrent invocation | Each selects its workspace and executable independently. | Bazel owns its server coordination; AL maintains no shared result ledger. |
| Forced kill | No completed observation is implied. | A capture may be partial and Bazel outputs may remain; inspect before retrying. |
Rerun selection when relevant source changes. Doctor has no persistent work to
resume; rerun it when local state changes.
Interactions with other systems
Configuration. The Bazel reference owns setup and
installation. Test selection is independent of delivery and uses Bazel’s
configuration. Doctor does not parse rc files. Neither starts al run plugins.
Output. Selection and test results describe the chosen scope. Doctor’s JSON
differentiates an unavailable source comparison from an observed stale installation.
Permissions. Selection reads Git and source state and can run Bazel tests.
Doctor needs read access to selected local files; it does not grant or repair access.
Concurrency. Selection and diagnostics can see changing local files. Rerun
selection when the source or build graph changes; it is not a reserved test plan.
Persistence and recovery. Tests can leave ordinary Bazel outputs and caches.
There is no AL results ledger. Doctor changes no repository, installation, or
scratch directory and creates no receipt.
Network. Bazel queries and tests use their configured services. Doctor
resolves a path and reads local files without launching that executable or
contacting a service. Selector dry run still performs dependency queries.
Edge cases
- Full-scope fallback is a conservative selection, not evidence that every test
is affected. Tests outside the explicitly requested scope remain outside it.
- A query failure is an error even if the failed query printed some labels.
- A selection report is not proof that tests ran: dry run, an empty selection,
caching, configured filters, or later test failure all affect execution.
- A build elsewhere remains unavailable to the default comparison; select its
path explicitly with
--source-binary to compare it. - The rc list is configured inventory, not evidence of files actually loaded.
An absent listed rc file can still appear in a successful report.
- A configured version pin is not an observation of the resolved executable’s
runtime version.
- An invalid scratch classification is reported with exit zero; callers must
inspect the JSON fields they care about.
- There is no implicit installation update after a source change.
Open questions and verification
- Sources: report implementation,
diagnostic fixtures, and
built-CLI fixture.
- Selector sources: selection and execution
and TestAffectedBazelCLI. Its
affected-bazel-tests.json artifact uses real Git and AL with an instrumented
Bazel process; it does not establish behavior against a real dependency graph. - Doctor’s namespaced and conflicting scratch classifications were observed in
the earlier C1 pass.
TestDoctorConfiguration exercises configurable input
paths and copied-binary comparisons in an isolated workspace. These checks do
not establish every workflow in another repository; terminal signals and
broken pipes still require their own observations. - Earlier forwarding observations describe a removed AL command and are not
evidence for ordinary Bazel execution or the affected-test selector.
- Affected-test observations remain pending. No runtime pass or speedup is
inferred from the source description.
- Checklist: affected tests.
- Checklist: diagnostics.
Source revision is the AL documentation baseline.
2.3.2.5 - Delivery
2.3.2.5.1 - Prepare, check, publish, and review a branch
Summary
al delivery prepares an explicitly scoped feature change, publishes the exact
branch commit, and maintains its pull request. The operator runs ordinary Bazel
checks between preparation and publication. Receipts bind separate invocations to the candidate and observed remote
state. Review inspection and review mutations are distinct operations; publishing
a branch does not mean that review completed or that the branch was merged.
The simple case
From the dedicated feature worktree’s repository root, run
al delivery provider, then al delivery inspect. Read the repository identity,
actual PR base, exact heads, changed paths, and refusals. Write the aggregate
message in task scratch and prepare only task-owned paths using repeated --path
flags or a deliberately prepared index.
Use al delivery prepare --message-file MESSAGE --receipt-file RECEIPT ...
to produce the candidate. Run the normal Bazel checks for the change, inspect
their results, then use al delivery publish --receipt-file RECEIPT when
publication is authorized. Receipt-bound verify and review inspect report
the current publication and review state. The
delivery reference
owns the complete recipes.
The interaction, event by event
Invoke
provider reads local remote configuration and reports sanitized forge and
transport capabilities without printing endpoint URLs. Adapter availability
and Git transport support are separate fields. The supported delivery workflow
requires same-repository GitHub topology and SSH fetch and push endpoints.
An HTTPS remote is refused; AL does not rewrite it automatically. Same-repository
ownership remains an operator precondition, not something author names prove.
inspect reads forge state and fresh Git refs, including the PR’s actual base.
It reports exact candidate and remote identities plus ownership and worktree
conditions. Ancestry and rebase decisions use the selected base. Advancing an
unrelated branch does not make that base stale; advancing the selected base can
require a rebase. Inspection does not itself grant authority to rewrite a branch.
Help prints flags. Unsupported provider/transport, unsafe history, mismatched
ownership evidence, stale refs, unsuitable worktree state, or changed PR
expectations can refuse later operations. A refusal states a failed precondition;
it is not a general promise that every earlier step of the workflow was undone.
Preparation is Git-only. It does not run Bazel or publish the branch. The
operator selects separate check commands and explicitly invokes publication.
Begins running
prepare stages the explicit task scope and creates one aggregate candidate.
--rewrite binds a one-commit replacement to the exact inspected head;
--consolidate explicitly selects an eligible owned multi-commit range. Both
cover the entire existing feature diff, not just newly edited files.
--message-only keeps the tree while changing the commit. Preparation writes a
private receipt binding the exact head, tree, scope, and remote expectations.
It does not derive affected targets or prescribe a check format.
The separate rebase command fetches current refs and, on an advanced base,
replays the eligible single feature commit locally. It leaves the remote feature
ref and PR unchanged. The report says rebased, includes the new local head and
tree, retains the observed remote head and lease, and reports pushed: false.
Its next_action directs the operator to prepare the new candidate, run ordinary
checks, and publish explicitly. An already-based branch reports already_based with
pushed: false, including when the remote feature branch does not yet exist.
This direct command does not prepare a replacement candidate receipt; the
operator prepares the result before publication.
While running
Run ordinary bazel build and bazel test commands for the prepared candidate.
Bazel owns their arguments, output, cache behavior, and exit status. AL does
not run the checks or store a results ledger. A failed check leaves the candidate
and preparation receipt available for diagnosis. Honor that failure before
publishing; if source is unchanged, retry the ordinary check without another
commit rewrite.
publish --receipt-file RECEIPT requires current HEAD and tree to match the
prepared candidate and requires a clean index and unchanged prepared scope. It rechecks the
remote lease and PR expectations. It does not inspect previous check output or
require a caller-supplied validated-head assertion.
If the base advanced, receipt-bound publication can rebase the captured
candidate, update the receipt, and stop with checks_required before pushing.
Run the normal Bazel checks against the new candidate, then publish using the
same receipt. Running prepare again is unnecessary unless content or message
changes.
Publication pushes the exact feature ref under its lease, updates or creates the
expected PR from the aggregate commit, and verifies the result. Branch push,
PR update, and final verification are distinct side effects. Conflicting PR
metadata is refused rather than silently overwritten.
Finishes
A verified publication means the captured branch and PR expectations were
observed at verification time. It does not merge the PR, deploy artifacts, or
prove future review outcomes. The state foundation
owns these completion boundaries.
If publication succeeded but its final read failed,
publication_verification_pending retains the known candidate and PR with
verified: false. Use verify --receipt-file RECEIPT to inspect that
postcondition before choosing recovery. A failed invocation can follow a
successful push or PR mutation; it does not establish that remote state is
unchanged. A guarded publication retry can finish an exact prior or desired PR
projection when the feature ref already equals the prepared candidate.
stateDiagram-v2
[*] --> Inspected: provider and inspect
Inspected --> Prepared: prepare exact scope
Prepared --> Checked: ordinary Bazel checks
Checked --> ChecksRequired: publish finds an advanced base
ChecksRequired --> Checked: check the rebased candidate
Checked --> PublicationAttempted: publish
PublicationAttempted --> VerificationPending: outcome not fully observed
VerificationPending --> Verified: verify
PublicationAttempted --> Verified: matching branch and PR
Verified --> [*]Checked represents the operator’s successful checks; it is not an AL receipt
status or a stored validation gate.
Review is a separate interaction
review inspect returns a bounded inventory of reviews, threads, comments, and
requests. It is an observation, not a review-execution monitor or a completion
signal. A newly published head does not inherit an older head’s review verdict.
For an authorized response, review address requires a clean exact prepared
candidate and verifies its remote publication. It posts the reasoned reply,
retains its attempt evidence, and resolves the selected thread. It does not fix
the code, run checks, or read validation logs. Low-level comment,
reply, resolve, and request operations remain available, each requiring the
fresh exact provider expectations described in the
review reference.
Replies and resolutions use bounded, short-lived receipt authority. Unknown
outcomes do not invite blind reposting; inspect remote state. Only an explicit
read-failure restoration permits reuse of the unchanged unexpired authority.
These guards do not make the forge’s writes atomic with another person’s edits;
an actively coedited PR is not a safe mutation target.
stateDiagram-v2
[*] --> Inventory: review inspect
Inventory --> GuardedReply: authorized address
GuardedReply --> ReplyRecorded: confirmed reply
GuardedReply --> InspectUnknownOutcome: interrupted acknowledgment
ReplyRecorded --> Resolved: guarded resolution
ReplyRecorded --> InspectUnknownOutcome: expired or changed expectation
Resolved --> Inventory: inspect againModifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | Repository, remote, base, executable, explicit path/index scope, rewrite choice, receipt, and publication flags select the operation and its boundaries. | Structured JSON identifies the captured refs, candidate, refusals, and publication state. |
| Environment and configuration | Forge credentials and Git signing must be available. AL credential plugins do not start; ordinary Bazel checks use their own configuration. | The provider report omits endpoint URLs; ordinary Bazel commands own their check output. |
| Terminal and streams | Delivery uses structured subprocess calls; it does not present a general interactive confirmation flow. | Reports use stdout and errors use stderr; retaining stdout is necessary to preserve returned candidate identities. |
Flags are fixed at invocation. Editing a receipt or captured input during work
can invalidate its exact-state guards.
Cancel and interrupt
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses the invocation signal model. | Active subprocess work is cancelled; retain candidate and receipt evidence because earlier mutations may remain. |
| SIGTERM | Requests cancellation. | No complete-workflow rollback; inspect local and remote postconditions. |
| Terminal closed (SIGHUP) | No special AL recovery. | Output can disappear before the outcome is observed; inspect existing receipt state. |
| Input or output pipe closes | No stdin confirmation is required for publication. | A report-write failure can follow a successful commit, push, or PR mutation. |
| Network lost | Provider detection remains local; inspection or publication reads can fail. | Push or forge outcome may be unknown; verify the remote postcondition before retrying. |
| Disk full or file inaccessible | Required message and receipt paths must be usable. | Candidate or receipt writing can fail; a command error does not remove already created commits. |
| Required state changes | Exact snapshots determine the candidate and expectations. | Candidate, index, prepared scope, refs, and PR metadata are rechecked; a changed base can require checks on a rebased candidate. |
| Concurrent invocation | Operations sharing a receipt contend for its lock. | Cooperating receipt writers serialize; remote leases guard the feature ref, but forge writes are not atomic with human edits. |
| Forced kill | No completion is implied. | Cleanup or evidence finalization may not run; inspect before recovery and do not erase attempt records to force a retry. |
Interactions with other systems
Configuration. Repository and tool selectors are explicit. The supported
GitHub adapter uses Git over SSH and the forge CLI for API operations. Provider
recognition is broader than supported delivery adapters.
Output. JSON reports and private local evidence serve different purposes.
Keep exact candidate identities and PR URLs from the report; a zero-exit
inspection does not certify that publication is safe or required.
Permissions. The operator chooses ownership and authorization. A receipt is
consistency evidence, not a permission grant. The command can create local
commits, replace an owned remote feature ref, and mutate PR state within the
explicitly chosen workflow.
Concurrency. Receipt locks cover cooperating AL operations; exact ref leases
detect remote progress. The forge still permits a concurrent edit between a
check and a mutation, so actively coedited metadata requires coordination.
Persistence and recovery. Preserve receipts and check evidence under ignored
task scratch. The operator decides which checks cover a changed candidate. Resolve
uncertain attempts by observation before any diagnosed manual recovery.
Network. Provider detection is local. Fresh inspection, publication,
verification, and review operations contact Git or the forge. Separate Bazel
checks can contact their configured build services. Direct rebase fetches
remote observations even though its branch update is local.
Edge cases
- A message-only amendment changes the candidate OID even when its tree is
identical; commit-sensitive checks may still change.
- A single generated path removed by the new base is not automatically lost
work: a rebase permits that reduction only when the prior candidate and base
tree entries are identical. Other scope changes are refused.
- Publication and receipt-bound verification require the exact candidate, clean
index, and unchanged prepared scope. Unrelated unstaged and untracked files
are preserved without a rebase; rebasing requires a fully clean checkout.
Review addressing also requires a fully clean prepared checkout.
- A base-ref race can be detected after a feature push; the feature ref can be
briefly visible before a guarded rollback attempt. Cross-ref atomicity is not
provided by the forge.
--no-pull-request is an explicit option for publication without an existing
PR; it does not silently remove an existing PR from the workflow.- Review reply evidence prevents blind duplicate replies, but it cannot prove
that every possible concurrent human moderation event was observed.
Open questions and verification
- Source:
internal/delivery/command.go, delivery.go, rebase.go,
review.go, review_address.go, and the linked command
reference. - Behavior fixtures:
delivery_integration_test.go,
review_address_test.go, and receipt_test.go in internal/delivery. - The isolated rebase fixtures check an advanced base with both an absent and an
existing remote feature ref, an already-based branch, and dirty-worktree
refusal. Their automated pass is recorded separately from historical rebase
observations in the verification protocol.
- Terminal loss, forced termination during remote writes, and provider races
require isolated failure fixtures; no live review comments were posted for
this description.
- Checklist: delivery.
Source revision is the AL documentation baseline.
2.3.2.6 - Foundations
2.3.2.6.1 - Invocation, streams, and interruption
Summary
AL exposes config, run, version, release, delivery, bazel, and doctor
directly. There is no intervening repo command. Help is available through
al --help, al COMMAND --help, and al help COMMAND.
Entry and output
Each invocation selects a command before any selected credential plugins start.
Only run starts configured plugins. An ordinary invocation succeeds with exit
status zero; execution errors normally produce a nonzero status and a diagnostic
on stderr. A child exit status can be preserved. Ordinary builds and tests invoke
Bazel directly; al bazel test selects tests from Git changes before running
Bazel. AL does not define a universal --json,
--quiet, or --dry-run option: use each leaf’s help.
config dump, doctor, release plan/inspect, website-operation dry runs, and
delivery reports produce JSON where documented.
version show produces text by default and accepts --format json. Release
commands primarily create files or perform one selected mutation. The nested
release website commands own extraction and activation. Success does not
require a JSON report. AL has no interactive command shell, background scheduler,
or automatic binary update step.
Relative path interpretation is command-specific. Version and delivery accept a
repository selector; doctor defaults to the current directory. Bazel-run tools
can start in a runfiles tree. Pass absolute paths for caller-owned files unless
the relevant command reference explicitly guarantees a different interpretation.
An installed run invocation does not always need Bazel runfiles. Its selected
plugin executables determine that requirement; invalid explicitly supplied
runfiles still fail. Command execution owns the
path and stream-file rules.
Interruption
AL requests cooperative cancellation on SIGINT and SIGTERM. There is no universal
second-Ctrl+C escalation: a second signal must not be described as a guaranteed
force kill. SIGHUP and SIGKILL have no AL cleanup handler. A cancelled or failed
invocation is not evidence that earlier writes were rolled back.
Version commands cancel their active Git process group. Bazel controls build
cancellation when invoked directly. Foreground Git can use the terminal
for authentication and AL restores terminal ownership. al run has a different
child and cleanup policy, owned by the
command lifecycle reference. Local release-generation
file copies do not uniformly check cancellation. Each feature’s table narrows
these guarantees instead of assuming all work responds identically.
Pipe closure is not a request for transactional rollback. A subprocess can stop
or output writing can fail after a durable operation. Check persistent state and
receipts before choosing a recovery action.
stateDiagram-v2
[*] --> Parse
Parse --> HelpOrError: short path
Parse --> Running: valid invocation
Running --> Completed
Running --> Interrupted
Interrupted --> InspectPersistentState
Completed --> [*]Common boundaries
Configuration flags are local to their command family. Ordinary lifecycle
commands do not automatically consume al run plugin configuration. Child
programs remain trusted programs with the operator’s access; AL is not a sandbox.
No command’s help text grants authority to deploy or overwrite external state.
Open questions and verification
- Source:
cmd/al/main.go, internal/cli/root.go, internal/cli/run.go,
internal/versioning/git.go, and internal/bazelcmd/main.go. - SIGHUP, broken pipes, and repeated signals need per-command terminal checks;
no universal output timing, color, or rollback claim is made.
- Checklist: invocation.
Source revision is the AL documentation baseline.
2.3.2.6.2 - State, identity, and completion
Summary
AL operates on several independent kinds of state. Choosing a source version
does not publish every project. Publishing artifacts does not activate a website.
Planning or inspecting a publication does not create or reserve its remote state.
Preparing or validating a delivery candidate does not itself update the PR.
Direct delivery rebase updates only the local candidate; publication remains a
separate guarded operation after preparation and validation.
State boundaries
| State | What the operator can observe | Owning feature |
|---|
| Configuration | Explicit files and their merged representation | Configuration |
| Plugin resources | Resources available while a selected child runs | Run |
| Source refs | Git branches and tags shared by project builds | Versioning |
| Bundle | Local manifest and copied payloads | Bundle |
| Publication | Complete verified payloads at one destination | Publication |
| Retained site and activation | Extracted content and the selected current link | Website operations |
| Candidate and PR | Exact commit, checks, remote branch, and review state | Delivery |
Projects share repository versioning and the operator workflow, but each release
is selected separately. Immutability applies while a publication exists. Explicit
deletion permits ordinary republishing; there is no restoration-only state.
Shared source tags survive artifact deletion.
Receipts
An artifact-operation receipt records requested steps as pending, then unknown
before remote work, then completed after confirmation. Its overall status is
running, completed, or incomplete. A killed process can leave running and
an unknown step. A lost connection can occur after the remote change, so unknown
never proves absence. Receipt creation must succeed before the associated step.
Use a different receipt path per attempt to preserve history. Artifact upload,
website extraction, and website activation use separate invocations and receipts;
the receipt retains their backend names upload, extract, and link.
A source-ref receipt reports verified Git publication. It is not the checkpointed
artifact-step journal. A delivery receipt binds the repository, refs, candidate,
path scope, and publication expectations. The operator runs and assesses checks
separately; the receipt does not record their results. Its lock prevents
cooperating AL operations from changing that receipt
at the same time. None of these files grants permission, proves current remote
state forever, or substitutes for fresh observations.
Recovery and concurrency
Whole workflows are not one transaction. An upload can succeed before a separate
website extraction fails; a branch push can succeed before PR metadata verification fails. Preserve
completed work and inspect the exact boundary before retrying. Do not edit trusted
receipts to manufacture matching state.
Release publication and source-ref operations use different locks. Artifact
publication serializes destination changes for a project. Source-ref operations
use the Git common directory, shared by linked worktrees. Forced termination can
leave a stale source-ref lock that requires operator investigation. There is no
single global lock coordinating all commands or unrelated external writers.
Open questions and verification
- Source:
internal/release/receipt.go, internal/release/ssh_deployer.go,
internal/versioning/releasepublish.go, and internal/delivery/receipt.go. - Inspect the code and tests when choosing recovery for an interrupted operation;
receipt formats are deliberately not interchangeable.
- Checklist: state.
Source revision is the AL documentation baseline.
2.3.2.7 - Glossary
Invocation and workspace
AL. The repository lifecycle executable described here.
Invocation. One execution of AL with fixed arguments and inherited environment.
Operator. The person or agent choosing a command and its authorized scope.
Workspace. A directory containing the build configuration for a Bazel invocation.
A Git repository can contain multiple workspaces.
Worktree. A checkout with its own working files and index. Linked worktrees
share Git objects and refs through a common Git directory.
Candidate. The exact commit and tree prepared for delivery, identified by OIDs.
OID. A Git object identifier used to bind an observation to exact content.
Trunk. The repository’s main development branch, normally master here.
TTY. An interactive terminal; pipes and redirected files are different streams.
Runfiles. Runtime files located by a Bazel-launched executable. Copying only
the executable does not necessarily supply them.
Plugin. A configured helper started by al run, with resources kept alive
while its consumer runs. A label selects plugins or individual calls.
Label. A key or key/value selector for configured plugins and calls; also,
in a Bazel command, a target address such as //path:target. Context distinguishes them.
Releases and durable state
Source version. The repository-wide identity calculated from source history;
its calendar rules belong to the module README, linked by the versioning document.
Project release. A publication identified by namespace, project, and version
at one destination. Projects choose when to publish a shared source version.
Bundle. A local directory with release.json and declared files under files/.
Manifest. The JSON description of a release, including identity and payloads.
Payload. A declared file whose name, byte size, and SHA-256 digest are recorded.
Digest. A cryptographic hash of content used to detect different bytes.
Namespace. The projects or third_party part of the public artifact path.
Destination. The selected SSH host, content root, and account context.
Staging. Temporary content prepared before a complete publication becomes visible.
Publication. A complete verified artifact set installed under its public identity.
Publication plan. A metadata-only preview of selected artifact identities,
destinations, the upload operation, and declared payloads. Website-operation dry
runs use the same report format for extraction or activation. Neither establishes
readiness or reserves destination state; source-ref publication uses a different plan.
Release inspection. Observations of local payload validity and remote
publication, retained-site, and activation state for a selected release.
The observations do not authorize mutation or make a later invocation atomic.
Retained site. An extracted website bound to a publication, available for activation.
Activation. Selecting a retained site through the destination’s current link.
Immutable. Existing published identity and bytes cannot be overwritten by AL.
Explicit deletion permits ordinary publication again; it does not preserve a tombstone.
Lease. An expected ref identity checked before publication. It detects conflicting
progress; it is not permission to overwrite unrelated work.
Receipt. A local record of observations. Artifact-operation, source-ref, and
delivery receipts are different formats with different recovery behavior.
Events that end or interrupt
Completion. The command reports success for the operation it actually performed.
It does not imply that every later release or delivery step has happened.
Cancellation. SIGINT (Ctrl+C) or SIGTERM requests cooperative shutdown. The
feature determines which subprocesses and resources respond.
Interruption. Any event preventing normal completion, including cancellation,
closed streams, network failure, changed state, or forced termination.
SIGHUP. A terminal-hangup signal; AL installs no special handler for it.
Forced kill. Termination that prevents application cleanup, such as SIGKILL.
Unknown. An artifact receipt step started but has not confirmed its outcome.
Unknown does not mean that the destination was unchanged.
Refusal. A guard rejects an operation. Earlier completed work may still exist;
read the operation’s recovery boundary.
Safe local observation. A read-only invocation or an invocation confined to
synthetic task scratch, with no live publication or real credential use.
Configuration and execution
Configuration. The merged explicit AL settings used by configuration inspection or command execution.
Standard streams. The child or AL process’s stdin, stdout, and stderr channels.
Exit status. The numeric result returned to the invoking shell; zero denotes success for the selected operation.
User Bazel configuration. Per-user defaults in ~/.bazelrc, including optional
agent output preferences. Bazel reads these alongside workspace configuration;
AL does not insert a configuration selection into build commands.
Cleanup. Shutdown and resource release after a child or plugin stops; it can fail and is not guaranteed after forced termination.
Source and delivery vocabulary
Channel. Development, nightly, or release context used to calculate and validate a source version.
Source ref. A Git branch or tag naming source history, shared independently of project artifact status.
Stamping. Supplying source version and identity metadata to a build.
Detached checkout. A checkout whose HEAD names a commit directly rather than a local branch.
First-parent history. The chain obtained by following the first parent of each commit; it determines release patch position.
Pull request (PR). The forge’s review object associated with a proposed branch change.
Forge. The service hosting repository metadata and review operations.
Path scope. The complete set of task-owned paths bound to a delivery candidate.
Atomic update. A particular operation makes its selected changes together; it does not imply that a multi-command workflow is one transaction.
Review authority. Short-lived receipt evidence binding an authorized review mutation to exact observed expectations; it is not permission by itself.
2.3.2.8 - Goal: describe the AL command-line product
Read README.md, glossary.md, foundations/invocation.md, foundations/state.md, and
releases/bundle.md. Match the pilot’s depth and eight-section skeleton.
Source of truth
Use the revision identified by the feature’s source footer. The original
descriptions share a baseline. Read the owning
command, state handling, defaults, and behavior tests at the selected revision.
When revising a feature for a later implementation, cite the revision examined
in its footer and update its checklist. Preserve the original commit and
executable identity of earlier observations.
The project path is projects/al, while Bazel consumers retain @rules_al.
Keep current source links and retained evidence locations accurate after moves;
original runtime paths inside historical records remain evidence of those runs.
Writing rules
Describe the operator’s experience, with technical mechanisms only in
> Technical note: blocks where they explain an observable consequence. Use
sentence-case headings and glossary terms. Explain surprising behavior directly;
record suspected defects instead of smoothing them over. Keep the fixed modifier,
interrupt, and cross-cutting rows from README.md in every feature document.
Use relative links to foundations. Include one stateDiagram-v2 for each
interaction. End with Open questions and verification and a source footer.
Mark scripted observations separately from manual verification.
Foundation references
State ownership and order
The bundle document owns local generation and minimal source identity. The
publication document owns artifact upload/deletion, nested release website
extraction/activation and their dry runs, remote staging, and operation receipts.
Versioning owns source refs and stamping. Delivery owns candidate, push, PR,
and review state. The operator’s ordinary Bazel commands own build and test
outcomes. Do not mix their meanings of completion.
Write the pilot, foundations, and publication yourself before delegating remaining
documents. Then check every result for consistent vocabulary, complete tables,
working relative links, source footer, and explicit unknowns. Add checklist rows
for observable claims and each nontrivial modifier/interrupt cell. Keep stable IDs.
Working rules
Select the OpenSpec change that covers the requested work in projects/al
using al-openspec. Use al-workspace for the task’s ignored scratch and
al-delivery for publication. Paths in verification records identify the
original runs. Keep this documentation in the AL repository. Authorized source fixes
belong to the implementation workflow; update affected claims, checklist results,
and triage history afterward. Update structure and coverage when files change.
No coverage row may remain not started at handoff; drafted is honest when manual
checks remain. Never infer rollback from a failure exit.
2.3.2.9 - Releases
2.3.2.9.1 - Artifact publication and website operations
Summary
al release plan previews the selected publication from local metadata.
al release inspect checks local payloads and observes the selected destination.
al release publish uploads selected project artifacts to that SSH destination.
al release website extract creates a retained site from a published archive;
al release website activate selects a retained site. These are separate
commands. al release delete removes an inactive release. Existing publications
are immutable until that explicit deletion.
The simple case
Build one project’s bundle using a shared source version. Select its bundle with
--release_dir, the environment with --environment, and an explicit SSH host
or deployment file. Run plan with those selections to inspect the identity,
destination, steps, and declared payloads without contacting the destination.
Use inspect when current local-file and remote-state observations are needed.
Then run publish explicitly to upload artifacts. For a website, separately
run website extract and website activate with the same bundle and destination.
Each website command supports an offline preview through --dry-run. Read the
completed-operation output and optional --receipt file. Other projects
need not be built or published. The operator recipe
provides complete destination flags and prerequisites.
The interaction, event by event
Invoke
AL reads each selected bundle’s manifest. An explicit --ssh_host or
--ssh_deployment selects all manifest items; otherwise the environment selects
matching SSH deployment items. An empty selection fails. A development identity
cannot be published. Third-party artifacts have their own namespace and support
upload and explicit deletion, but not website extraction or activation.
The command selects one operation: publish uploads, website extract
extracts, website activate activates, and delete deletes. There is no generic
step-selection flag. Extraction accepts --site_archive to select a declared
archive. Activation selects an already retained site without reading a local
archive. Each operation runs independently.
Help makes no release changes. Invalid destinations, unsafe identities, and
unsupported selections fail before their operation. OCI metadata can be generated,
but OCI publication is disabled because its old mutable-tag path cannot provide
the publication guarantee. This refusal does not fall back to SSH automatically.
plan and inspect are observations, not implicit requests to publish. A plan
does not validate local payload bytes, authenticate to SSH, or establish that the
selected destination will accept the operation. Inspection can observe changed
state without authorizing its replacement. Neither report is an operation receipt.
If --receipt is requested for a mutation, AL must initialize its private local
file before remote work. Website --dry-run writes an offline plan without
performing that operation; combining it with --receipt, even an explicitly
empty value, fails before effects. A later bundle or destination can fail after
earlier ones completed; the invocation is not an atomic transaction across all
selections.
Begins running
For artifact upload, AL checks an existing public identity under the destination lock. If the canonical
manifest, complete file set, sizes, and digests match, upload succeeds without
opening local payloads or transferring them again. A mismatch refuses overwrite.
For a new identity, AL verifies and copies local files to staging, transfers the
complete set to destination staging, then verifies it there. Publication exposes
the complete directory in one promotion. A failed transfer does not expose a
partial new public release.
While running
The selected operation begins only after its receipt checkpoint, if requested. The
state foundation owns pending, unknown, and
completed meanings. AL prints Completed STEP for PROJECT/VERSION in ENVIRONMENT
after confirming each step. A subsequent failure preserves prior completed steps.
website extract fetches the declared published archive, verifies it, and
extracts it locally before promoting a retained site. A root index.html is required.
Archive types, entry limits, and rejected members
are part of the operator contract. The local disk must hold the archive and
extracted content. Uploading an archive alone never extracts it.
website activate verifies the retained site’s binding and published payloads,
then selects it through sites/PROJECT/current. Earlier retained sites remain
available. Rollback is an explicit website activate for another retained
version. A failed extraction leaves activation unchanged.
Deletion first checks both release and site paths, managed ancestry, mounts,
and active-site status before removing either tree. An active website must be
replaced by another retained selection first. Deletion is guarded, but its two
removals are not a crash-atomic pair: an interruption can leave only one removed.
Finishes
A successful upload means downloadable files exist at the selected identity.
Successful extraction means a retained site exists; successful activation means
it is selected. Successful deletion means the selected release and retained site are
absent. Deleting an already absent release succeeds. Shared Git tags remain.
After deletion, ordinary publication can reuse the identity with different bytes.
There is no tombstone, restoration command, or requirement to reproduce the old
contents. Publication receipts are evidence of an attempt, not locks on future
state. After an unknown outcome, run inspect with the same bundle and destination
selection. Compare its publication digest and observed state with the receipt,
then retry only the intended unresolved step. Inspection does not update the
receipt or reserve the observed state for that retry.
stateDiagram-v2
[*] --> Absent
Absent --> Staging: upload
Staging --> Published: verify and promote
Published --> Published: identical retry
Published --> Refused: conflicting bytes
Published --> RetainedSite: website extract
RetainedSite --> Active: website activate
Active --> RetainedSite: select another version
RetainedSite --> Absent: delete
Published --> Absent: deletePreview and inspection are separate interactions
plan reads the selected manifests and destination configuration, applies the
publication selection rules, and returns a JSON description of what was selected.
Its metadata-only result names the project identity, upload operation, destination,
declared payloads, and canonical publication digest. It distinguishes selection
through an explicit host/deployment from selection through environment metadata.
When SSH configuration owns the port, the report leaves it unspecified instead
of inventing a resolved connection setting.
The plan uses schema release/artifact_plan/v1 and mode offline_metadata.
Each entry in operations includes selection (explicit or environment),
the namespace/project/version, source identity when applicable, requested steps,
payload names/sizes/digests, publication digest, and public/site paths. Its
destination describes environment, host or SSH alias, root, and account selectors.
Its port and ssh_user are null when OpenSSH configuration owns their
resolution. A null publish_user means commands use the SSH login account
directly. The report omits credential material and identity/trust-file paths.
Website extract --dry-run and activate --dry-run produce the same plan schema
for their fixed operation. Their report retains backend operation names extract
and link; the artifact plan uses upload. This is a preview, not an inspection
of archive bytes, site validity, or the current link. Each website dry run rejects
--receipt before remote work.
Planning does not open payload files, start SSH or rsync, initialize an operation
receipt, or create destination state. A valid plan can therefore name missing
local payloads or an unavailable destination. Run the selected publication command
separately; it rereads inputs and performs its own checks. This publication plan
is distinct from a source-ref publication plan. Both release observation
commands reject --receipt; it belongs to mutating operations.
inspect uses the same bundle and destination selection, verifies local payloads,
and reads the remote publication and retained-site state. Local and remote
observations are independent: a matching remote publication can coexist with
missing local files, which matters for an identical upload retry. Inspection
does not create staging, acquire a mutation lock, repair a publication, extract
a site, or change the current selection.
Activation is reported independently from retained-site validity. A selected site
does not become valid merely because the current link points to it. When a read
fails, its state remains unavailable or unknown rather than being reported absent.
Inspection does not load an earlier receipt; the canonical publication digest
helps the operator compare an observation with the identity recorded in one.
Inspection uses schema release/artifact_inspection/v1 and mode
read_only_snapshot, adding observed_at when its reads finish. The timestamp
does not make its multiple reads atomic. Each operation adds these observations:
| Field | Reported states and meaning |
|---|
local | Each payload is verified, missing, corrupt, or unreadable. These findings do not suppress the remote read. |
remote.status | absent, matching, conflicting, corrupt, or unavailable. Matching requires the expected canonical manifest and complete regular file set with the expected sizes and hashes. |
remote.site.status | absent, retained, active, conflicting, corrupt, not_applicable, or unavailable. Site validation checks the binding, guarded ancestry, and regular root index.html; it does not rehash every extracted site file. |
remote.site.active | true when the current link selects this version, independently of site validity; false for a known unselected version; null when selection is unavailable, inapplicable, or unsafe. A selected dangling link can still report true. |
remote.site.current | absent, selected, other, dangling, unsafe, not_applicable, or unavailable. This distinguishes the current link’s condition from the selected site’s validity. |
A completed inspection can exit zero while reporting missing, unreadable,
conflicting, or corrupt content. Zero means the observations completed, not that
publication or activation is ready. With valid metadata selections, a failed SSH
read, invalid response, timeout, or excessive response leaves remote fields
unavailable, emits the JSON report, and returns a nonzero status with a diagnostic.
These failures do not report the release absent.
Cancellation during local payload verification stops that work before the remote
read and can return before a JSON report is written. It is an interrupted
inspection, not a finding that the payload is corrupt.
stateDiagram-v2
[*] --> ReadSelection
ReadSelection --> Refused: invalid metadata or selection
ReadSelection --> MetadataReport: plan
ReadSelection --> VerifyLocalAndReadRemote: inspect
VerifyLocalAndReadRemote --> ObservationReport: observations available
VerifyLocalAndReadRemote --> IncompleteObservation: required read fails
MetadataReport --> [*]: no publication
ObservationReport --> [*]: no publication
IncompleteObservation --> [*]: inspect reported failuresModifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | The command selects upload, extraction, activation, or deletion. Destination, project/namespace, timeout, and SSH flags select its target; extraction also accepts an archive. plan, inspect, and website --dry-run do not mutate it. | Observations and website dry runs return JSON. Mutations print confirmed-step lines and optionally checkpoint --receipt evidence. |
| Environment and configuration | --environment selects a destination group. Normal SSH configuration supplies trust and authentication for inspection and publication; planning uses only declared settings. | Unresolved SSH settings remain unspecified in the plan; no credential values belong in manifests or receipts. |
| Terminal and streams | Planning needs no connection or terminal input. Inspection and publication use noninteractive SSH with strict host-key checks. | Reports use stdout; a closed output stream can prevent receipt of a complete observation or completion line. |
Flags are fixed for the attempt. A changed destination file or bundle requires a
new invocation; do not edit inputs during publication.
Cancel and interrupt
For plan, inspect, and website --dry-run, interruption can prevent a complete report but does not
turn the observation into a publication or recovery action. The remote changes,
staging, and receipt checkpoints described below apply to mutating commands.
An interrupted inspection must be rerun to obtain fresh observations.
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses invocation cancellation. | Active work is cancelled where observed; completed steps remain and a started step may be unknown. |
| SIGTERM | Requests cancellation. | Same recovery boundary as Ctrl+C; no complete-workflow rollback. |
| Terminal closed (SIGHUP) | No special recovery. | Remote work may have occurred; inspect receipt and destination. |
| Input or output pipe closes | Commands do not ask for a confirmation on stdin. | Loss of completion output does not prove failure of remote work. |
| Network lost | Connection or trust checks fail. | Staging can remain; after a lost acknowledgment the public outcome can be unknown. |
| Disk full or file inaccessible | Unwritable requested receipt prevents remote work. | Staging, extraction, or checkpoint can fail; preserve earlier completed steps. |
| Required state changes | Inputs determine the attempted identity. | Destination contents and bindings are rechecked under lock; conflicting contents fail. |
| Concurrent invocation | Both can inspect the same destination. | Final locked verification preserves an existing identity; identical contenders can succeed. |
| Forced kill | No completed step is implied. | Cleanup may not run; a receipt may remain running with an unknown step. |
Interactions with other systems
Configuration. Destination selection uses explicit release options and
manifest deployment metadata, not al run credential plugins.
Output. Completion lines describe individual steps. The canonical public
manifest omits transport configuration; the local receipt includes the resolved
destination and publication digest. Planning and inspection return JSON reports
whose observations do not become checkpoints for a later invocation. Website
dry runs use that same plan format; receipt/completion names retain the backend
extract and link operation names.
Permissions. The operator needs SSH access and the configured content-account
rights. The operator reference owns tool,
mode, and timeout defaults. AL does not provision the receiver.
Concurrency. The destination lock protects cooperating project operations.
External changes are not authorized by that lock and must still satisfy checks.
Persistence and recovery. Whole-attempt atomicity is not promised. Preserve
receipts and inspect the selected destination after an unknown outcome. Compare
the selected digest and observed state before retrying the intended unresolved
step. Never infer that a failed invocation deleted or restored earlier work. A plan is a preview;
inspection reports what its reads observed and does not reserve that state.
Network. OpenSSH and rsync contact the selected destination. The separate
infrastructure mirror is outside this command and can replace public state under
its own operator workflow. Planning is offline. Inspection uses SSH reads and
does not transfer a new publication through rsync.
Edge cases
- An identical upload can succeed even when the local payload files are missing.
- An extra remote file or a corrupt byte causes retry verification to fail.
- Symlinked ancestry and nested mounts, including bind-mounted files, block
deletion. Mounts inside a selected retained site also block activation.
- A retained site’s binding must match the selected publication; sharing a version
string is insufficient.
- A plan can succeed without readable payloads or usable SSH credentials; it
verifies metadata selection only. Inspection can report remote content even
when those local payloads are missing or corrupt.
- An inspection’s active selection is not proof that the site is valid or
serving successfully. Use its site and current-link findings together.
- A current-link target containing a control character, including an added
newline, is unsafe. Its near-match to a version name does not establish selection.
- Multiple release directories and destination groups can leave partial overall
progress even though each publication has its own guarded boundary.
Open questions and verification
- Source:
internal/release/cmd.go, deployer.go, observation.go,
ssh_deployer.go, ssh_config.go, receipt.go, and lifecycle_test.go. - Planning and inspection fixtures in
observation_test.go exercise the built
CLI with controlled SSH transport and compare destination contents before and
after each observation. The final fixture record also covers cancellation
during local hashing before SSH starts. These automated observations are
recorded as O1 in the verification protocol.
Site inspection deliberately does not verify every extracted file; readers
must not interpret it as a full website integrity scan. - Lost acknowledgments, forced termination during deletion, and external writers
require destination-state observations. They are not covered by local help checks.
- Checklist: publication.
Source revision is the AL documentation baseline.
2.3.2.9.2 - Generate a project bundle
Summary
al release generate assembles declared payloads and release metadata into a
local bundle. Generation makes files inspectable; it does not publish anything.
The simple case
Create a workspace-status file and one payload, then run
al release generate --project projects/example --version_file STATUS --add_file PAYLOAD --output_dir EMPTY_DIRECTORY. Inspect release.json and
files/ in the output. The payload retains its basename. For ordinary project
builds, use the owning releases:bundle target and
version stamping, as described by the
module’s build recipe.
The interaction, event by event
Invoke
The operator chooses a project, status file, and payloads. Repeat --add_file
for several files. AL reads files to record sizes and SHA-256 digests. Optional
input manifests and deployment metadata are merged before outputs are written.
The source identity is the version, channel, commit, and tree state supplied by
the build; optional GitBundle history can provide release-page changelogs.
Help writes command usage. Missing inputs, invalid status values, unsafe names,
colliding basenames, and bundles without payloads fail. A nonempty output
directory is refused; generation is not an overwrite operation.
Begins running
For a bundle, AL creates the destination’s files directory after checking the
identity and available inputs. Nondevelopment first-party bundles require clean
source identity. Development bundles can be inspected but cannot be published.
While running
AL copies payloads into the output. Source symlinks can resolve to regular
payload files. A copying failure can leave a partial local output directory;
the absence of a completed manifest distinguishes it from a completed bundle.
Do not reuse that nonempty directory as the next generation destination.
Finishes
The bundle manifest is written after payload copies finish. Optional
--output_manifest and --output_release_page also write explicit outputs.
A successful invocation leaves local files; no destination has been contacted.
stateDiagram-v2
[*] --> InspectInputs
InspectInputs --> Refused: invalid input or occupied output
InspectInputs --> CopyPayloads
CopyPayloads --> PartialLocalOutput: copy fails
CopyPayloads --> WriteManifest
WriteManifest --> BundleReady
BundleReady --> [*]Modifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | Payload, project, status, merge and output flags choose the local artifacts; --output_file_mode controls manifest/page permissions. | --indent controls JSON layout; help lists all output options. |
| Environment and configuration | Explicit build inputs supply release metadata; AL plugin configuration is not loaded. | No plugin startup output. |
| Terminal and streams | Files are written to explicit paths; a terminal is not required. | Generated artifacts are files; errors use the command diagnostic stream. |
These selections are fixed at invocation; changing a source file during the copy
is not a supported way to change a bundle.
Cancel and interrupt
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses the invocation signal model. | File copying does not promise prompt cancellation; inspect local output. |
| SIGTERM | Uses the invocation signal model. | No transaction-wide rollback of local outputs is promised. |
| Terminal closed (SIGHUP) | No special AL recovery. | Files already written can remain. |
| Input or output pipe closes | Payloads come from named files, not stdin. | Diagnostic stream closure has no rollback guarantee. |
| Network lost | No effect for ordinary local inputs. | No effect for ordinary local inputs. |
| Disk full or file inaccessible | Reading required inputs fails. | Copy or manifest writing fails; partial local files can remain. |
| Required state changes | Current inputs are read. | Concurrent input edits have no snapshot guarantee; use stable inputs. |
| Concurrent invocation | Each must use its own empty output. | A shared output has no whole-bundle locking contract. |
| Forced kill | No completed output is implied. | Partial files remain; generate into a fresh directory. |
Interactions with other systems
Configuration. Release flags and status metadata are explicit; no credential
plugins start.
Output. The state model distinguishes the local
manifest from the canonical public manifest.
Permissions. Inputs must be readable and output writable. Payload copies use
ordinary file permissions; the manifest/page mode is a separate option.
Concurrency. Use stable inputs and one output directory per invocation.
Persistence and recovery. Inspect local output after failure and choose a
fresh empty output for retry. Generation has no artifact-operation receipt.
Network. Generation does not contact an SSH or OCI destination.
Edge cases
- Two payloads with the same basename cannot share one bundle.
- Every bundled manifest item needs a corresponding local
--add_file source. - Third-party version ownership differs from first-party source stamping.
- An already generated bundle is not evidence of remote publication.
Open questions and verification
- Source:
internal/release/generator.go, bundle.go, cmd.go, and
bundle_test.go; built-CLI fixture: cmd/al/lifecycle_e2e_test.go. - File-copy interruption latency and shared-output races need explicit runtime
observations; no prompt-stop guarantee is inferred from signal registration.
- Checklist: bundle generation.
Source revision is the AL documentation baseline.
2.3.2.9.3 - Inspect versions and publish source refs
Summary
al release create creates a weekly source branch and its initial tag.
al version calculates the shared source version, prepares nightly and patch
tags, publishes reviewed source refs, and supplies version metadata to builds.
These operations do not select projects or publish their artifacts. The
calendar scheme owns the development,
nightly, weekly-branch, and patch naming rules.
The simple case
Run al version show --format json to inspect the current checkout’s version,
channel, commit, branch, and tree state. For an authorized weekly release, start
from clean trunk and run al release create. AL creates the weekly branch and
its initial tag atomically, leaving HEAD and the checkout on trunk. Run
git checkout releases/YYYY.W with the branch name that create printed to
select the release before building or tagging it. AL provides no checkout command.
Write a source-ref plan with al version release-plan --lease weekly-release --plan PLAN, inspect the exact refs and commit, then use
al version release-publish --plan PLAN --receipt RECEIPT. A successful receipt
reports verified remote source refs. Build and publish each desired project
separately through bundle generation and
artifact publication.
The interaction, event by event
Invoke
The selected repository defaults to the Bazel workspace environment when
present, otherwise the current directory. --repository chooses a checkout.
Version-command shared flags work before or after the leaf command.
al release create has its own repository, trunk, date, and dry-run flags.
show reads source state without creating refs. --channel disambiguates
release and nightly inspection; --release supplies a release-line context for
a detached checkout or its matching release branch. These selectors do not
retag the source. Ref-changing commands reject them rather than interpreting
them as permission to change the selected version.
Help prints the relevant flags. Invalid channels, calendar values, missing
required plan paths, or unsupported output formats fail. Local ref preparation
requires a clean eligible branch with no Git operation in progress. Dry runs
check the same ref eligibility and namespace collisions without creating refs.
Creation never changes the selected branch; choosing another checkout is a
separate Git operation.
An ordinary untagged development checkout can be inspected while dirty, but
nondevelopment stamping refuses a dirty checkout. A source-ref plan cannot
publish a development version.
Begins running
version nightly-tag creates a local nightly tag on clean trunk. release create
creates the weekly branch and initial tag together without switching HEAD.
version release-tag creates the
current patch tag on a clean weekly branch. Existing local refs are not
silently overwritten. A second nightly on the same unchanged commit is refused,
even when its date would produce a different tag name.
release-plan writes and prints the reviewed JSON plan. This is a local file
operation; it does not publish refs. release-publish reads that exact plan,
checks the selected remote, and acquires the shared source-ref operation lock.
Its --atomic setting must match the plan. Atomic publication needs an explicit
lease value; a remote that cannot provide the requested atomic update causes a
refusal rather than an automatic non-atomic fallback.
While running
Source publication checks remote ref expectations again under the local lock.
Absent create refs may be created; existing refs are acceptable only at the
expected commit. A conflicting tag or branch fails. A patch plan verifies the
already delivered weekly branch independently of a diverged trunk.
bazel-status prints workspace-status metadata without launching a build.
In this repository, bazel build --config=release TARGET invokes the installed
AL status command for the current workspace. Install or update AL before the
build; the status command does not bootstrap another Bazel process. The
build reference owns setup and explicit
version selection. Bazel controls build output, status, and cancellation.
Finishes
Local ref preparation prints the created tag or branch. Source publication
rechecks the remote refs and prints its receipt, also writing it when
--receipt is selected. Building with stamping produces build outputs; neither
that build nor source-ref publication uploads a project’s bundle.
Completion of the remote operation can precede local evidence writing. If
writing the receipt or stdout fails, the refs can already exist remotely.
Inspect those refs before recovering. Release creation and checkout are separate:
if the later git checkout fails, the branch and tag created by AL still exist.
stateDiagram-v2
[*] --> InspectSource: invoke
InspectSource --> Reported: show or dry run
InspectSource --> LocalRefs: release create
LocalRefs --> ReleaseSelected: git checkout releases/YYYY.W
ReleaseSelected --> PlanWritten: release-plan
PlanWritten --> CheckRemote: release-publish
CheckRemote --> Refused: conflicting expectations
CheckRemote --> RemoteRefs: guarded publication
RemoteRefs --> VerifiedReceipt: verify and write evidence
RemoteRefs --> InspectOutcome: evidence or verification fails
VerifiedReceipt --> [*]Modifiers
| Variant | Changes what happens | Changes what is printed |
|---|
| Arguments and flags | Repository, trunk, inspection channel, release context, date, dry run, plan, remote, and atomic options select their documented operation. | show --format json adds structured state; local preparation prints a ref; plan and publication commands print JSON. |
| Environment and configuration | The default repository can come from the Bazel workspace environment; Git identity, transport, signing, and trust use the selected operation’s Git setup. No AL credential plugins start. | Git diagnostics can accompany failures; stamping emits its defined status keys. |
| Terminal and streams | Foreground Git authentication can use the controlling terminal; piped execution has no equivalent terminal guarantee. | Reports and workspace-status keys use stdout; failures use stderr. |
Arguments are fixed at invocation. Changing a checkout or plan during an
operation is not a supported way to revise the chosen release.
Cancel and interrupt
| Event | Before work | During work |
|---|
| Ctrl+C once or twice | Uses the invocation signal model. | Active Git receives cancellation; already created refs can remain. |
| SIGTERM | Requests cancellation. | Uses the same cancellation path; no whole-workflow rollback is promised. |
| Terminal closed (SIGHUP) | No special AL recovery. | Inspect refs and the source-ref lock before retrying. |
| Input or output pipe closes | Local inspection requires no stdin confirmation. | Git authentication or report writing can fail; published refs may already exist. |
| Network lost | Local inspection and local ref preparation need no remote. | Publication may fail before or after a remote update; absence of a receipt is inconclusive. |
| Disk full or file inaccessible | Repository or plan reads fail. | Local ref changes or evidence writes can fail; inspect what was already created. |
| Required state changes | Current source state determines the operation. | Source/ref expectations are rechecked; conflicting remote state is refused. |
| Concurrent invocation | Local ref creation checks expected refs. | Source publishers sharing a Git common directory contend for the operation lock; remote creates remain guarded. |
| Forced kill | No completion is implied. | Cleanup may not run; a source-ref lock or completed refs can remain without a receipt. |
Interactions with other systems
Configuration. Version selectors are distinct from plugin configuration.
The source preparation reference owns
calendar defaults and the standard release sequence.
Output. Text, JSON, ref names, and workspace-status keys are operation-specific;
there is no single output format flag across all version commands.
Permissions. Inspection needs repository access. Ref preparation needs local
Git write access; publication also needs access to the selected remote.
Concurrency. The state foundation
owns the distinction between source-ref and artifact locks. The local source-ref
lock is shared by linked worktrees; it does not lock arbitrary external writers.
Persistence and recovery. Plans and receipts record exact identities. Inspect
created refs after interruption, investigate stale locks, and preserve evidence.
An artifact deletion does not delete these shared source refs.
Network. Source publication uses Git. Local inspection and local ref
preparation do not contact the remote; a stamped build can use whatever network
access its Bazel setup requires.
Edge cases
- A detached checkout with both nightly and release tags can require an explicit
channel. AL refuses ambiguous context instead of guessing.
- A weekly patch is derived from first-parent position, not from the number of
projects released or the number of times publication was attempted.
- Dry run does not guarantee a later mutation will succeed after another writer
changes the refs.
- A non-atomic plan is an explicit choice and can leave partial remote progress
after failure; AL does not silently downgrade an atomic plan.
- Inspecting a source version is not proof that any project built from it has
been published.
- Creating a weekly release leaves version inspection on the original trunk
context until an ordinary Git checkout selects the release branch.
Open questions and verification
- Source:
internal/release/cmd.go, internal/versioncmd/cobra.go, command.go,
cmd/workspace_status/workspace_status.sh, and internal/versioning/git.go,
releaseplan.go, and releasepublish.go. - Behavioral evidence:
internal/versioncmd/command_test.go,
internal/versioning/git_integration_test.go, publication_integration_test.go,
and the controlling-terminal cases in cmd/al/lifecycle_e2e_test.go. - Source-publication acknowledgment loss and receipt-write failure need isolated
observations; no live source refs were changed for this document.
- Checklist: versioning.
Source revision is the AL documentation baseline.
2.3.2.10 - Verification protocol
These checklists compare the source-derived description with a running AL.
They do not authorize a live publication. Use synthetic inputs and isolated
repositories or the existing behavior fixtures.
AL’s source now lives in projects/al, with Bzlmod name rules_al unchanged.
The baseline and C2/R1/O1 records below predate that move. C2’s retained scratch
directory moved with the project; its current location is listed below, while
raw recorded arguments and source paths retain their original provenance. A
location update is not a new verification pass or a broader portability result.
Checklists
| File | Covers |
|---|
| Foundations | Invocation and state boundaries |
| Releases | Bundles, source refs, artifact publication, website operations and their previews |
| Delivery | Candidate, publication, and review |
| Commands | Configuration, child execution, affected tests, diagnostics |
Run a pass
- Build AL at the source revision in the feature’s footer or establish that the
executable inputs match that revision. Group checks by revision. Record commit,
executable SHA-256, time, operating system, and whether a TTY is present.
- Install only into ignored task scratch, or invoke the built executable with
its declared runfiles when that is the surface being checked. Keep the two
cases distinct. Use absolute fixture paths.
- Read each linked claim. P1 covers shared facts and suspected defects, P2
ordinary behavior, and P3 numeric details. Run P1 before P2, then P3.
- Use the named isolated setup. Record
pass, fail, or blocked, with the
means of observation. Leave — for unrun rows. Preserve stdout, stderr, exit
status, and relevant resulting files outside tracked documentation. - A mismatch can be a document error. Correct that before filing a product
defect. Deduplicate real suspicions in triage.
- Keep coverage
drafted after an automated pass. Mark a document verified
only after its P1/P2 rows are manually observed or failures are filed and its
remaining limitations are explicit. Never renumber used checklist IDs.
Setups
- Local: Linux, Bash, pipes unless TTY is specified; source-built binary,
no user configuration, minimal synthetic environment, task-local output.
- Git: fresh scratch repository with a clean commit, trunk
master, local
identity and signing disabled for fixtures; optional local bare remote.
Never run mutation rows in the feature worktree or against GitHub. - SSH fixture: the existing
internal/release/lifecycle_test.go controlled
transport fixture or root infra/download/test/sync loopback SSH fixture.
Use fixture content roots and synthetic identities only. Failure injection
belongs inside that setup; do not disconnect or alter a real host. - Delivery fixture: existing delivery integration fixtures with isolated Git
repositories and a controlled forge. Actual candidate publication is separately
evidenced by delivery receipts, not by these test rows.
- Interrupt fixture: a controllable slow child/transport or filesystem with
a visible checkpoint. Send signals only to its recorded PID. Observe state
before retrying. SIGHUP, repeated signals, and TTY prompts require dedicated
terminal observation; piped output is not a substitute.
Historical baseline observations
On 2026-11-02 a scripted pass exercised 30 invocations against the executable
whose SHA-256 is 019074063ca33f92755b608da59da4a1922a385744624ed7fdcac13738f41bf5.
The executable’s AL source matched the original post-rebase snapshot 4a10748.
These observations predate the fixes and remain historical evidence. Fifteen
observations cover configuration/run/Bazel/doctor; fifteen cover help, version
preparation/publication to a local bare remote, bundle output, and local Git history generation. The generated
bundle’s payload hash was independently checked against its manifest.
The history-export command has since been removed; that original observation is
retained only as historical evidence and has no current feature/checklist row.
The original Bazel-forwarding observations likewise describe a removed command;
ordinary builds now invoke Bazel directly.
The original weekly preparation observations included an automatic checkout.
They do not verify the current al release create behavior, which leaves the
checkout unchanged and requires ordinary Git to select the release branch.
The delivery observations recorded on 2026-11-02 also predate the check-plan and
results-ledger removal. Their Git/review findings retain their original scope;
they do not establish current check selection or stored validation readiness.
Evidence is task-local under
out/unify-release-versioning/rebase-description/observations-agent/ and
observations-release/. The command checklist cites the stable observation IDs;
release checks cite their IDs likewise. The evidence uses only synthetic inputs.
B-01 and B-02 were reproduced; B-03 was source-derived in this original pass.
This pass did not inspect interactive rendering, terminal prompts, repeated
signals, actual credential providers, or a live release destination. Existing
E2E fixture results from delivery validation are separate evidence. No document
is marked manually verified, and unrun checklist rows remain —.
Later fixture passes
The following automated passes on 2026-11-02 exercised the corrections during
candidate preparation. They supplement the 30 original observations; they do
not replace their provenance or establish a manual pass.
| Record | Scope | Retained evidence |
|---|
| C2 | TestRunStandaloneCLI (8 cases), TestRunStreamFiles (2), and TestRunPluginEnvironment (3) passed against a copied binary-only installation and synthetic child/plugin helpers. | projects/al/out/unify-release-versioning/run-fixes/after-artifacts/observations/ contains 13 JSON artifacts. Failing-before artifacts remain in the sibling before-artifacts/ directory. |
| R1 | TestRebasePreservesRemoteUntilPublication (existing/absent remote), TestRebaseAlreadyBasedPreservesRemote, and TestRebaseRequiresCleanWorktree passed in isolated repositories and a controlled forge. | out/unify-release-versioning/bug-fixes/rebase-before.log and rebase-after.log; the passing target emits rebase-local-false.json and rebase-local-true.json as undeclared outputs. |
| O1 | The final complete release package passed, including TestReleaseObservationCLI, TestSelectedDestinationCLI, and TestReleaseInspectionCancellationCLI. The built CLI checked offline planning, destination observations, unchanged destination trees, and cancellation during local hashing. | Under out/unify-release-versioning/release-observation/, final-release-test.log records the pass and final-evidence/ contains 25 numbered observation reports (2 plans, 23 inspections), selected-plan.json, and inspection-cancellation.json. Earlier reports remain in evidence/; the missing-command, current-link-newline, and local-hash-cancellation failure logs are retained separately. |
The checklists cite C2, R1, and O1 by exact test/subcase or artifact names.
File-mode and marker observations are limited to those retained fixture outputs.
Source-derived next_action wording and later-startup truncation behavior retain
unrun rows. O1 covers missing/corrupt local payloads; absent, matching, conflicting,
corrupt, and unavailable remote publications; retained, active, invalid, unsafe,
and dangling website selections; and failed, malformed, timed-out, or excessive
remote responses. The cancellation fixture records a prompt nonzero exit during
local hashing with no SSH startup; its elapsed time is an observation, not a
product timing guarantee. Cancellation before report encoding need not emit JSON. Timeout and excessive-output cases occupy reports 07/08 in an
unspecified order. Direct receipt reconciliation, third-party inspection, and
unreadable local-payload rows remain unrun.
These passes do not exercise live Vault, GitHub, release destinations, interactive
prompts, repeated signals, or every failure window. Coverage remains drafted
throughout.
After the move to projects/al, the CLI, Bazel-command, and delivery test targets
passed against the changed source. These are bounded fixture checks of the new
doctor inputs and selected-base handling, not a verification of every AL workflow
in another repository. Earlier C1/C2/R1/O1 records retain their original meaning.
| Record | Scope | Retained evidence |
|---|
| C3 | TestDoctorConfiguration runs seven installed-binary cases: defaults, configured paths, absent/different source binary, missing/invalid pins, and an empty rc path. | Under out/unify-release-versioning/portability/after-artifacts/cli/test.outputs/, seven doctor-*.json files retain arguments, streams, and exit status. |
| R2 | TestDeliveryInspectionUsesSelectedBase covers an explicit release base and the base from an existing PR, first with unrelated trunk advancement and then with selected-base advancement. | Under out/unify-release-versioning/portability/after-artifacts/delivery/test.outputs/, selected-base-{false,true}.json and selected-base-advanced-{false,true}.json retain the four reports. |
Failing-before evidence remains under the sibling before-artifacts/ directory.
No live forge, credential provider, or release destination was used for these
checks. All document coverage remains drafted.
Separate website-operation fixtures
The later W1 release and CLI package pass exercised the nested
al release website extract and activate commands. TestReleaseObservationCLI
checks each offline dry run with unusable transport executables and a nonexistent
identity path, verifies unchanged destination trees, and rejects a requested
receipt without creating it. TestLifecycleCLI checks the retired step selector
and archive flags on commands that do not own them.
Evidence is retained under
out/unify-release-versioning/api-naming/website-evidence/:
observation-01-plan.json records upload-only planning;
observation-02-extract.json and observation-03-activate.json record the two
website previews; al-retired-invocations.json records unsupported inputs.
manifest.json identifies the commands, passing validation scope, and evidence
hashes. The separate real loopback OpenSSH/rsync sync fixture also passed;
sync-receipt.json retains its filesystem observations and named checks.
The pass is scripted and isolated. It does not establish a live-destination or
manual-terminal pass. O1 and the original history-export observation retain their
historical scope; they are not rewritten as observations of these new commands.
Ordinary Bazel release-build fixtures
The B1 ordinary-Bazel pass retains evidence under
out/unify-release-versioning/api-naming/. plain-bazel-root-help.txt shows the
six command families present before affected-test selection was added.
plain-release-consumer/result.json records a
real tagged Git consumer built with bazel build --config=release :bundle, its
version/commit identity, and independently verified payload hash. The associated
dirty build fails, and restoring the source reproduces the manifest. A separate
missing-al-build.log records a real Bazel workspace-status failure with
installation guidance when AL is absent. These are local scripted checks;
they do not publish artifacts or exercise credential services.
Explicit release creation and checkout fixtures
The C1 pass uses the installed CLI in a real local Git fixture.
out/unify-release-versioning/api-naming/release-create-evidence/release-creation.json
records both refs at the original trunk commit and unchanged HEAD after
al release create, dry-run ref preservation, and dirty/occupied-ref refusals.
The same fixture checks out the release with ordinary Git, verifies stamped
release identity, and creates its next patch tag. The fixture date is
2026-08-30 (release 2026.35), rather than the example date in the checklist.
release-create-evidence/manifest.json records current command help and
rejection of the retired command, switching option, and nonexistent AL checkout.
release-create-consumer/result.json records the separate plain-Bazel build
following creation and Git checkout, with verified payload bytes and clean
recovery after the dirty-build refusal. These are isolated scripted observations;
no remote release or website was published.
Git-only source-publication fixtures
The D1 source-snapshot pass exercises preparation, publication, and
verification without a check-plan or result ledger. Under
out/unify-release-versioning/api-naming/, source-publication.json records
equal prepared, published, and remote heads with verified publication.
publication-review-recovery.json records an initial
publication_verification_pending report followed by successful verification
of the same published head and PR after the read failure clears.
These are isolated Git/forge fixtures from
TestDeliveryPreparePublishVerify and
TestPublicationRetainsEvidenceAfterReviewFailure. They do not prove that an
operator ran sufficient ordinary Bazel checks or exercise a live forge.
These observations remain separate from the earlier API’s dated records;
the delivery feature
identifies the implementation described.
Affected-test selection with real Bazel
The B2 scripted pass uses the task-local CLI and an isolated Git repository
with a real Bazel 9.3.1 graph. Under
out/unify-release-versioning/api-naming/, affected-real-results.json records
nine cases: transitive selection, manual wildcard suites, explicitly named
suites and tests, selected execution, configuration changes, deletion, unmapped
files, and unchanged source. The transitive case selects one dependent test and
excludes its unrelated neighbor. affected-real-test-target.txt identifies the
selected executable’s retained test output. The not-manual tag remains eligible.
affected-bazel-run-selection.json separately records a successful selector
invocation through the ordinary bazel run entry point.
affected-bazel-tests.json records 23 CLI scenarios using real Git and an
instrumented Bazel boundary, including partial-query refusal, test failure,
cancellation, local change collection, and manual-suite selection.
These observations establish selection and execution for the fixture, not a
performance measurement or coverage of every repository workspace. The initial
XML-output compatibility failure is retained in affected-real-selection.log;
the final command uses Bazel-native filtering and label output.
Not checkable by hand
An observation cannot prove the absence of every race or crash window. Source
inspection and adversarial fixtures are required for atomicity, exact lease
checks, unsafe path rejection, and cleanup guarantees. A passing isolated fixture
does not establish behavior under every filesystem, service, or concurrent edit.
2.3.2.10.1 - Verification: configuration, command execution, and diagnostics
This checklist records the documentation baseline
and its earlier scripted runs. The configuration cases retain the original Lua
fixtures, IDs, and results. To examine configuration after the migration to
declarative files, use Inspect configuration
and its source revision. The verification protocol describes how
to record a new pass. All three feature documents remain drafted.
Fixture conventions
- AL: the source-built installed executable, selected by its absolute path.
Run each case with a fresh directory under ignored
out/<task>/<case>. - Clean environment: preserve only
PATH pointing to private fixture
executables followed by /usr/bin:/bin, LANG=C.UTF-8, a task-private
TMPDIR, and explicitly named fixture variables. Do not inherit credentials. - R: the same setup with
RUNFILES_DIR pointing to an empty case-local
directory. C1 used this setup to exercise execution beyond the original B-01;
it does not substitute for the separate binary-only installed cases. - Merge inputs:
first.json contains a plugin named first with a
nonexistent executable and label fixture=first; second.yaml contains a
plugin named second; third.lua calls config with a plugin named third.
Do not select these plugins for execution. - Gate configuration: a trusted case-local Lua file writes a
ready marker,
then loops until a case-local continue file exists, then calls config({}).
Use this only to interrupt setup or change a later input before it is loaded.
Bound every experiment to 20 seconds and signal only its recorded process ID. - Waiting child: a case-local Python program writes
ready, registers a
SIGTERM handler that writes stopped and exits, then waits. A separate variant
deliberately ignores SIGTERM. No child contacts a service or reads real secrets. - Bazel fixture: a private executable named
bazel records whether it was
invoked. Put its directory first on PATH to check doctor path resolution and
that diagnostic reporting does not launch Bazel. No real build is needed. - Doctor workspace: use a case-local
.bazeliskrc with the repository’s
declared pin fields when testing failures or changes. Ordinary observations
can read the repository workspace. Never alter its actual pin file. - Controlled doctor read: use a FIFO named
.bazeliskrc only inside a
disposable doctor workspace. Its local writer opens the FIFO, records
readiness, waits for a case-local gate, then writes the pin fields and closes
it. Record both process IDs; terminate only these fixture processes afterward. - TTY: observe a foreground command in a disposable terminal. For hangup,
close only that terminal and inspect case-local files from another terminal.
Broken-pipe and forced-kill cases use a local parent process and its recorded
children; do not signal unrelated processes.
- Timing: if an invocation finishes before an intended interrupt, mark that
case
blocked or retry with a newly recorded controlled fixture. A signal sent
after completion is not evidence that interruption was exercised. - Failure injection: use a disposable unprivileged fixture account or an
already available isolated filesystem for inaccessible/full-file cases.
If unavailable, record
blocked; never fill or remount a host filesystem. - Plugin fixture: the repository’s existing synthetic injector scenario in
tools/al/test/command/command_test.go; no live Vault or real credentials.
The first scripted record is C1, observed on 2026-11-02 at 11:14:50 UTC:
out/unify-release-versioning/rebase-description/observations-agent/run-20261102T111450282581Z/observations.json.
It retains exact arguments, environment, stdout, stderr, exit status, and selected
file contents/modes for 15 invocations. Its binary was built at 3161f1c; the
described command, configuration, plugin, and lifetime sources had no differences
at 4a10748. The record includes the full binary digest. Results below identify
C1’s stable observation IDs. A repeated observation uses fresh case paths and a
new record; do not replace C1. C1 results below are historical observations of
that baseline, not a rerun against the refreshed source snapshot.
The later C2 fixture pass on 2026-11-02 covers the 13 cases in
cmd/al/run_e2e_test.go: TestRunStandaloneCLI, TestRunStreamFiles, and
TestRunPluginEnvironment. It copies the built AL into isolated installation
directories and uses synthetic child/plugin executables. Artifacts are retained
at projects/al/out/unify-release-versioning/run-fixes/after-artifacts/observations/
from the repository root. Each JSON filename is the test/subcase name with /
replaced by _; it records exit status, streams, child/plugin markers, and file
contents/modes. Failing-before artifacts remain in the sibling before-artifacts/
directory. C2 is automated evidence and does not change coverage to verified.
This directory was relocated from tools/rules_al/out/ with the AL project;
the artifacts still describe the original run, not a post-move rerun.
The post-move C3 pass covers the seven TestDoctorConfiguration cases.
Its current input paths, results, and scope are recorded in the
verification protocol.
It supplements the earlier observations without replacing them.
Inspect configuration
| ID | P | Needs | Claim | Setup | Steps | Expected | Result |
|---|
| CFG-01 | P1 | AL | No input files produce an empty representation (simple case). | Clean environment; no configuration flags. | 1. Run AL config dump. 2. Capture stdout and status. | Exit 0; stdout is exactly {} plus newline. | Scripted pass, C1 config-empty. |
| CFG-02 | P1 | AL | Repeated configuration flags preserve list-entry order (begins running). | Merge inputs. | 1. Run dump with -c first.json -c second.yaml -c third.lua. 2. Read plugin names from JSON. | Names are first, second, third in that order. | Scripted pass, C1 config-merge. |
| CFG-03 | P2 | AL | The representation is indented JSON (modifiers). | Merge inputs. | 1. Run the CFG-02 invocation. 2. Inspect captured stdout. | Parseable multiline JSON with indented entries. | Scripted pass, C1 config-merge. |
| CFG-04 | P1 | AL | File output truncates previous contents (finishes). | Existing output containing repeated previous synthetic contents; empty configuration. | 1. Run AL config dump -o OUTPUT. 2. Read the complete file. | File is exactly {} plus newline. | Scripted pass, C1 config-output-private-truncated. |
| CFG-05 | P1 | AL | File output restricts an existing file to mode 0600 (finishes). | Existing output mode 0644. | 1. Run CFG-04. 2. Inspect permission bits. | Permission bits are 0600. | Scripted pass, C1 config-output-private-truncated. |
| CFG-06 | P2 | AL | Selecting a file leaves stdout empty (modifiers). | Existing writable output; empty configuration. | 1. Run dump with -o OUTPUT. 2. Capture stdout. | Stdout is empty. | Scripted pass, C1 config-output-private-truncated. |
| CFG-07 | P1 | AL | Invalid values are omitted from diagnostics (exits immediately). | JSON with vault_auth containing string synthetic-private-marker as no_auth. | 1. Dump the invalid file. 2. Search captured diagnostic for the marker. | Nonzero status; diagnostic excludes the marker. | Scripted pass, C1 config-invalid-redacted. |
| CFG-08 | P2 | AL | Configuration errors use stderr (modifiers). | Same invalid JSON as CFG-07. | 1. Capture both streams separately. 2. Run dump. | Stdout is empty; the error is on stderr. | Scripted pass, C1 config-invalid-redacted. |
| CFG-09 | P2 | AL | Only explicitly selected files are loaded (modifiers). | Put invalid al.lua in the case directory. | 1. Run AL config dump there without --config. 2. Read output. | Empty JSON succeeds; the unselected file has no effect. | — |
| CFG-10 | P2 | AL | Trusted Lua can include an environment-derived value (modifiers). | Lua contributes a plugin name from synthetic AL_FIXTURE_NAME=from-environment. | 1. Select only that Lua file. 2. Inspect the dump. | The synthetic value appears as the plugin name. | — |
| CFG-11 | P2 | AL | Declarative inspection needs no TTY or stdin (modifiers). | Empty configuration; stdin closed; captured output pipes. | 1. Run AL config dump without a terminal. 2. Capture result. | Empty JSON succeeds. | — |
| CFG-12 | P2 | TTY, gate | Cancellation can stop configuration loading before output work (interrupts). | Gate configuration followed by another file; output initially absent. | 1. Wait for ready. 2. Press Ctrl+C once. 3. Inspect output and status. | Cancellation is reported; no complete dump is claimed. | — |
| CFG-13 | P2 | TTY, gate | A second Ctrl+C has no guaranteed force-kill meaning (interrupts). | Same gate setup; a separate invocation for this row. | 1. Wait for ready. 2. Press Ctrl+C twice. 3. Record exit and output state. | Record behavior; do not infer a universal second-signal escalation. | — |
| CFG-14 | P2 | AL, gate | SIGTERM cancels before a later configuration load (interrupts). | Gate first, synthetic second input, absent output. | 1. Wait for ready. 2. Send SIGTERM to AL. 3. Inspect result. | No completed merged dump is reported. | — |
| CFG-15 | P1 | AL, controlled writer | Cancellation does not promise restoration of truncated output (interrupts). | Large synthetic dump and preexisting output; watch for its truncation. | 1. Start dump. 2. Send SIGTERM after output changes. 3. Inspect all retained bytes. | Record resulting bytes; no restoration guarantee is assumed. | — |
| CFG-16 | P2 | TTY, gate | Hangup has no setup recovery protocol (interrupts). | Gate setup in disposable terminal. | 1. Wait for ready. 2. Close terminal. 3. Inspect process and output. | Record termination and residue; no successful dump is implied. | — |
| CFG-17 | P2 | TTY, controlled writer | Hangup can leave incomplete output (interrupts). | Large synthetic dump to a file; disposable terminal. | 1. Close terminal after output begins. 2. Inspect file completeness. | Record retained bytes; a partial file is not treated as success. | — |
| CFG-18 | P2 | AL | Closing stdin does not remove named declarative inputs (interrupts). | Valid JSON file; closed stdin. | 1. Run dump selecting the file. 2. Parse output. | Input is read from its path and succeeds. | — |
| CFG-19 | P2 | AL, pipe | A closed output pipe need not contain a complete dump (interrupts). | Large synthetic configuration; reader closes after first bytes. | 1. Start dump into the controlled reader. 2. Close reader. 3. Capture process status separately. | Record failure/termination and partial stream; no complete JSON guarantee. | — |
| CFG-20 | P2 | AL, offline fixture | Local declarative loading needs no network before work (interrupts). | Valid local JSON/YAML; already isolated offline environment. | 1. Run dump with network unavailable. 2. Parse output. | Local inputs succeed. | — |
| CFG-21 | P2 | AL, gate | Local declarative inputs remain independent of network during work (interrupts). | Gate followed by local JSON; no Lua network activity. | 1. Wait at gate in isolated offline environment. 2. Create continue. 3. Parse output. | Local merged representation succeeds. | — |
| CFG-22 | P1 | AL | Missing input fails before output replacement (interrupts). | Missing selected configuration; output containing preserve. | 1. Run dump to that output. 2. Read the file. | Error; existing output remains preserve. | — |
| CFG-23 | P1 | AL, failure injection | Output failure can leave changed contents (interrupts). | Synthetic large dump and isolated limited output storage. | 1. Start writing. 2. Trigger the isolated limit. 3. Inspect status and file. | Write fails; record any partial content. | — |
| CFG-24 | P2 | AL, gate | Inputs are read as their turn arrives (interrupts). | Gate first, second file naming plugin old. | 1. Wait for ready. 2. Change second file to new. 3. Open gate. | Later file contributes new. | — |
| CFG-25 | P2 | AL, controlled input | Concurrent source editing has no whole-input snapshot guarantee (interrupts). | Large synthetic configuration and a writer confined to that file. | 1. Start dump. 2. Change the input while read is active. 3. Record output or error. | Record observation; no atomic snapshot is assumed. | — |
| CFG-26 | P2 | AL | Independent invocations can use separate outputs (interrupts). | Two valid inputs and two absent output paths. | 1. Start both dumps. 2. Wait for both. 3. Parse both files. | Each contains its selected representation. | — |
| CFG-27 | P2 | AL | Shared output is not serialized by a documented lock (interrupts). | Two large different configurations; one disposable output. | 1. Start both dumps to that path. 2. Inspect results and file. | Record final content; do not require one atomic complete winner. | — |
| CFG-28 | P2 | AL, gate | Forced kill before output gives no completed dump (interrupts). | Gate and absent output. | 1. Wait for ready. 2. Send SIGKILL to AL. 3. Inspect output. | No successful completion is reported. | — |
| CFG-29 | P2 | AL, controlled writer | Forced kill may leave partial output (interrupts). | Large synthetic dump to fresh output. | 1. Send SIGKILL after writing starts. 2. Inspect retained content. | Record partial/full bytes; process termination is not a completion receipt. | — |
| CFG-30 | P2 | AL | Unsupported .yml suffix is refused (invoke). | Valid YAML saved as config.yml. | 1. Select it with --config. 2. Capture result. | Nonzero status identifying invalid extension. | — |
| CFG-31 | P2 | AL | Dumping does not reject duplicate plugin names (edge cases). | Two JSON files with the same plugin name. | 1. Dump both. 2. Count plugin entries. | Both entries remain in JSON. | — |
| CFG-32 | P2 | AL | Trusted Lua can print before the JSON representation (edge cases). | Lua file calls print("synthetic prefix"), then config({}). | 1. Dump that file. 2. Capture stdout. | Synthetic prefix precedes the JSON representation. | — |
Not checkable by hand:
- The absence of an output lock or a whole-input snapshot is a source-derived
boundary; individual race observations cannot prove every possible outcome.
- Historical Lua fixtures predate native-configuration-targets and no longer describe supported inputs. Their original effects needed a
separate review; this checklist covers only synthetic configuration programs.
Run a command with plugins
| ID | P | Needs | Claim | Setup | Steps | Expected | Result |
|---|
| RUN-01 | P1 | Installed AL | A child without selected plugins runs without runfiles (summary). | Clean environment; no adjacent or declared runfiles. | 1. Run the TestRunStandaloneCLI/plain installed fixture. 2. Inspect its child receipt and status. | Exit 0; the intended child runs. | Fixture pass, C2 TestRunStandaloneCLI/plain; C1 failure retained in B-01 history. |
| RUN-02 | P1 | R | A no-plugin child runs when explicit runfiles setup is available (while running). | R; no configuration or labels. | 1. Run AL run -- /usr/bin/printf 'synthetic child output'. 2. Capture stdout. | Exit 0; exact child text. | Scripted pass, C1 run-empty-runfiles-no-plugins. |
| RUN-03 | P1 | R | Positive child exit status is preserved (finishes). | R; Python child immediately exits 23. | 1. Run child through AL. 2. Inspect AL status. | Exit 23. | Scripted pass, C1 run-child-exit-code. |
| RUN-04 | P1 | R | Configuration alone selects no plugins (begins running). | R; first merge input names a nonexistent plugin executable. | 1. Run with --config first.json, no label, and a child printing no selected plugin. 2. Capture result. | Child succeeds; plugin executable is not needed. | Scripted pass, C1 run-unselected-plugin. |
| RUN-05 | P1 | Installed AL | Output overrides create missing files (output). | TestRunStreamFiles/existing-false; absent stdout/stderr paths. | 1. Run the fixture. 2. Read both output files. | Both files contain exactly their child stream bytes. | Fixture pass, C2 TestRunStreamFiles/existing-false; C1 refusal retained in B-02 history. |
| RUN-06 | P1 | Installed AL | Output overrides truncate old trailing bytes (modifiers). | TestRunStreamFiles/existing-true; both outputs contain longer old text. | 1. Run the fixture. 2. Read the complete output files. | Each contains only its new child stream bytes. | Fixture pass, C2 TestRunStreamFiles/existing-true; C1 stale bytes retained in B-02 history. |
| RUN-07 | P1 | Installed AL | Output overrides retain existing permissions (permissions). | C2 existing-output fixture; initial modes 0644. | 1. Run the fixture. 2. Inspect both retained output modes. | Existing stdout/stderr files remain 0644. | Fixture observation, C2 TestRunStreamFiles/existing-true; same boundary observed in C1. |
| RUN-08 | P2 | R | An input override supplies the child’s stdin (modifiers). | R; input file exactly synthetic input plus newline. | 1. Run /usr/bin/cat with --stdin INPUT. 2. Capture stdout. | Exact input bytes reach stdout. | Scripted pass, C1 run-stdin. |
| RUN-09 | P2 | R | Arguments after -- belong to the child (modifiers). | R; child prints its argument list. | 1. Pass --literal and two words after the separator. 2. Read list. | Arguments arrive unchanged and remain separate. | — |
| RUN-10 | P2 | Plugin fixture | Selected plugin startup is reported on stderr (modifiers). | Synthetic fixture; capture streams separately. | 1. Start its selected plugin and ordinary child. 2. Inspect stderr. | Startup messages identify the plugin. | — |
| RUN-11 | P1 | R | Inherited environment reaches the child (modifiers). | R plus synthetic AL_TEST_VALUE=example; child prints only that key. | 1. Run child through AL. 2. Read output. | Output is example. | — |
| RUN-12 | P1 | Plugin fixture | Plugin environment exports reach the child (modifiers). | Synthetic injector fixture exports only a case-local synthetic resource path. | 1. Run its consumer. 2. Check the consumer’s receipt. | Consumer reads the selected synthetic resource. | — |
| RUN-13 | P1 | Plugin fixture | Startup logging names exported keys without printing their returned values (modifiers). | Synthetic distinct export value; child deliberately prints nothing. | 1. Run fixture. 2. Search AL startup logs. | Key name appears; synthetic value does not. | — |
| RUN-14 | P2 | R, TTY | Ordinary streams are inherited (modifiers). | R; interactive echo child; no overrides. | 1. Type a synthetic line in the foreground. 2. Observe child output. | Child receives input and prints on the same terminal. | — |
| RUN-15 | P2 | R, gate | Cancellation during setup prevents a subsequent child launch (interrupts). | Gate configuration; child would write a separate launched marker. | 1. Wait for gate readiness. 2. Press Ctrl+C. 3. Inspect child marker. | Child launch is not completed. | — |
| RUN-16 | P1 | R, TTY | Ctrl+C requests shutdown without a defined second-press escalation (interrupts). | Waiting child; disposable terminal. | 1. Wait for child readiness. 2. Press Ctrl+C once, then repeat in a fresh case with two presses. 3. Record shutdown. | Record child/AL termination and cleanup; no universal escalation is assumed. | — |
| RUN-17 | P2 | R, gate | SIGTERM during setup prevents a later child launch (interrupts). | Gate configuration; child writes launched. | 1. Wait for gate readiness. 2. Send SIGTERM to AL. 3. Inspect marker. | Child does not reach its marker. | — |
| RUN-18 | P1 | Plugin fixture | Resources remain available while a cancelled child shuts down (interrupts). | Existing synthetic injector cancellation fixture. | 1. Start the fixture’s cancellation scenario. 2. Wait for readiness. 3. Request cancellation and inspect stopped evidence. | Child confirms access to its synthetic file during shutdown. | — |
| RUN-19 | P2 | R, TTY, gate | Setup hangup has no AL cleanup guarantee (interrupts). | Gate configuration in disposable terminal. | 1. Wait for readiness. 2. Close terminal. 3. Inspect processes and files. | Record residue; no child completion is inferred. | — |
| RUN-20 | P2 | R, TTY | Hangup during execution requires state inspection (interrupts). | Waiting child in disposable terminal. | 1. Wait for child readiness. 2. Close terminal. 3. Inspect only recorded child/process state. | Record termination and remaining resources; no cleanup guarantee is assumed. | — |
| RUN-21 | P2 | R | Default streams can be pipes at invocation (interrupts). | R; finite synthetic stdin pipe to cat. | 1. Run cat through AL. 2. Close input after one line. 3. Read output and status. | Child sees its input and EOF, then exits normally. | — |
| RUN-22 | P2 | R, pipe | Output pipe closure is handled by the child before AL cleanup (interrupts). | Child writes repeatedly to a controlled reader. | 1. Start child through AL. 2. Close reader after first bytes. 3. Record child and AL completion. | Record child stream failure; prior writes are not undone. | — |
| RUN-23 | P2 | Plugin fixture | A failed network-dependent startup prevents the child (interrupts). | Synthetic plugin fixture configured to fail startup without contacting a live service. | 1. Start selected plugin with a marker-writing child. 2. Inspect status and marker. | Nonzero status; child marker absent. | — |
| RUN-24 | P2 | Local service fixture | Network loss during execution follows the selected child’s policy (interrupts). | Synthetic child using only a disposable loopback service. | 1. Wait for child readiness. 2. Stop its service. 3. Record child failure and AL cleanup. | Record child/service behavior; no AL-wide network retry is assumed. | — |
| RUN-25 | P1 | R | Inaccessible required stream prevents child startup (interrupts). | Missing stdout override; marker-writing child. | 1. Invoke run. 2. Inspect status and marker. | Failure before child marker exists. | — |
| RUN-26 | P2 | R, failure injection | Child write failure does not undo earlier writes (interrupts). | Child writes a marker, then writes into isolated limited storage. | 1. Run child. 2. Trigger fixture storage limit. 3. Inspect marker. | Earlier marker remains after failure. | — |
| RUN-27 | P2 | R, gate | Setup checks later inputs when reached (interrupts). | Gate configuration followed by another selected file. | 1. Wait at gate. 2. Remove later file. 3. Open gate. | Setup fails before child execution. | — |
| RUN-28 | P2 | R | Changing a file during child execution does not restore its old contents (interrupts). | Waiting child; independent case-local file containing old. | 1. Wait for child readiness. 2. Replace file with new. 3. Stop child. | File remains new. | — |
| RUN-29 | P2 | R | Independent invocations can prepare separate outputs (interrupts). | Two children with separate case-local marker paths. | 1. Start both through AL. 2. Wait for both markers. | Both independent children run. | — |
| RUN-30 | P2 | R | Shared output is not protected by a command-wide lock (interrupts). | Two output-writing children; one disposable existing file. | 1. Run both with the same stdout override. 2. Inspect file and statuses. | Record interleaving/final bytes; no serialization guarantee is assumed. | — |
| RUN-31 | P2 | R, gate | Forced kill during setup gives no completed child execution (interrupts). | Gate and marker-writing child. | 1. Wait at gate. 2. Send SIGKILL to AL. 3. Inspect child marker. | No successful child completion is reported. | — |
| RUN-32 | P1 | R | Forced kill can leave a child running (interrupts). | Waiting child; retain its PID and AL PID. | 1. Send SIGKILL only to AL. 2. Inspect child. 3. Stop only the recorded fixture child afterward. | Record survival/residue; do not infer cleanup from AL termination. | — |
| RUN-33 | P1 | R | Duplicate plugin names fail even without selected labels (configuration). | R; configuration contains two plugins with one name. | 1. Run with no labels and a marker-writing child. 2. Inspect status. | Duplicate-name error prevents child. | — |
| RUN-34 | P2 | Plugin fixture | Bare label key matches any configured value (edge cases). | Synthetic plugin labelled fixture=selected. | 1. Invoke with --plugin_label fixture. 2. Inspect startup evidence. | Plugin is selected. | — |
| RUN-35 | P2 | Plugin fixture | Any matching selector is sufficient (begins running). | Synthetic plugin labelled fixture=selected. | 1. Supply fixture=selected and another nonmatching key. 2. Inspect startup. | Matching plugin starts. | — |
| RUN-36 | P2 | Plugin fixture | A selected call starts its owning plugin (edge cases). | Plugin’s own labels do not match; its call label does. | 1. Select the call label. 2. Inspect plugin/call evidence. | Owning plugin starts for the call. | — |
| RUN-37 | P1 | Plugin fixture | Startup failure rolls back partially initialized resources (begins running). | Existing injector startup-failure scenario. | 1. Run that scenario. 2. Inspect consumer marker and synthetic file directory. | Child never runs; synthetic resources are cleaned up. | — |
| RUN-38 | P1 | Plugin fixture | Ordinary completion removes synthetic plugin resources (finishes). | Existing injector success scenario. | 1. Run its consumer. 2. Wait for AL return. 3. Inspect its synthetic resource directory. | Synthetic resource files are absent. | — |
| RUN-39 | P1 | Plugin collision fixture | Different selected exports for one key prevent child launch (begins running). | C2 conflict and conflict-reversed cases. | 1. Run both cases. 2. Inspect status and child marker absence. | Nonzero status; the child never writes its receipt. | Fixture pass, C2 TestRunPluginEnvironment/conflict and conflict-reversed. |
| RUN-40 | P1 | Plugin fixture | Equal selected exports for one key are accepted (edge cases). | C2 equal-export case, including an unselected conflicting plugin. | 1. Run TestRunPluginEnvironment/equal. 2. Inspect the child receipt. | The child receives the shared selected value. | Fixture pass, C2 TestRunPluginEnvironment/equal. |
| RUN-41 | P1 | Installed AL | An absolute selected plugin path needs no runfiles (invoke). | C2 absolute-plugin case; no runfiles context. | 1. Run TestRunStandaloneCLI/absolute-plugin. 2. Inspect plugin and child receipts. | The selected plugin starts and the child runs successfully. | Fixture pass, C2 TestRunStandaloneCLI/absolute-plugin. |
| RUN-42 | P1 | Installed AL | A relative selected plugin identifier requires runfiles (invoke). | C2 relative-plugin case; no runfiles context. | 1. Run TestRunStandaloneCLI/relative-plugin. 2. Inspect status and child marker. | The command fails before child launch. | Fixture pass, C2 TestRunStandaloneCLI/relative-plugin. |
| RUN-43 | P1 | Installed AL | Invalid declared runfiles remain setup errors (invoke). | C2 invalid-manifest and invalid-directory cases. | 1. Run both cases. 2. Inspect status and child marker absence. | Both commands fail before child launch. | Fixture pass, C2 TestRunStandaloneCLI/invalid-manifest and invalid-directory. |
| RUN-44 | P1 | Installed AL | A valid runfiles context resolves a relative selected plugin (invoke). | C2 relative-plugin-with-runfiles case. | 1. Run the case. 2. Inspect child and plugin receipts. | The plugin and child run successfully with the declared context. | Fixture pass, C2 TestRunStandaloneCLI/relative-plugin-with-runfiles. |
| RUN-45 | P2 | Installed AL | Adjacent runfiles are propagated to the child (invoke). | C2 adjacent-runfiles case. | 1. Run the case. 2. Inspect the child context receipt. | The child receives the discovered runfiles directory. | Fixture pass, C2 TestRunStandaloneCLI/adjacent-runfiles. |
| RUN-46 | P1 | Installed AL | New output files have private permissions (permissions). | C2 missing-output fixture with its ordinary permission mask. | 1. Run TestRunStreamFiles/existing-false. 2. Inspect both output modes. | Both new output files have mode 0600. | Fixture pass, C2 TestRunStreamFiles/existing-false. |
| RUN-47 | P1 | Plugin fixture | Selected exports can override inherited values (begins running). | C2 equal-export case; inherited synthetic value differs. | 1. Run the case. 2. Inspect the child receipt. | The selected export replaces the inherited value. | Fixture pass, C2 TestRunPluginEnvironment/equal. |
| RUN-48 | P1 | Plugin collision fixture | Conflict diagnostics use stable plugin ordering (begins running). | C2 conflict and conflict-reversed cases. | 1. Run both declaration orders. 2. Compare the conflict diagnostic. | Both name the same key and plugins in the same order. | Fixture pass, C2 TestRunPluginEnvironment/conflict and conflict-reversed. |
| RUN-49 | P1 | Plugin fixture | Export diagnostics omit returned values (begins running). | All three C2 environment cases; synthetic values known to the fixture. | 1. Run the cases. 2. Search captured stdout/stderr for those values. | Returned values are absent from the captured diagnostics. | Fixture pass, C2 TestRunPluginEnvironment. |
| RUN-50 | P1 | Plugin collision fixture | Started plugins clean up after an export conflict (begins running). | Both C2 conflict cases with startup/shutdown markers. | 1. Run each case. 2. Inspect both plugins’ retained markers. | Both plugins record startup and shutdown even though the child is refused. | Fixture pass, C2 TestRunPluginEnvironment/conflict and conflict-reversed. |
| RUN-51 | P1 | Installed AL | A later setup failure does not restore truncated output (output). | Existing nonempty output; selected relative plugin without runfiles. | 1. Run with that stdout override and plugin selection. 2. Inspect status and file. | The child is refused; the output file remains truncated. | — |
Not checkable by hand:
- Best-effort cleanup cannot promise secure erasure or recovery from every host
failure; consult the owning lifecycle reference instead of extrapolating from
successful fixture cleanup.
Select affected tests
The selector cases use TestAffectedBazelCLI and its
affected-bazel-tests.json artifact where named below. That fixture runs real
Git and AL against an instrumented Bazel process. It checks selection inputs,
fallback decisions, output, and invocation boundaries; a separate real Bazel
graph verifies dependency selection. B2 records the scripted fixture results;
unperformed cases remain unmarked.
| ID | P | Needs | Claim | Setup | Steps | Expected | Result |
|---|
| BAZ-41 | P1 | Installed AL fixture | The selector requires a valid explicit base (invoke). | Fresh Git/workspace fixture; missing, nonexistent, and option-shaped base values. | 1. Run the selector for each invalid input. 2. Inspect exit, stdout, and Bazel calls. | Failure before tests; no successful selection report. | — |
| BAZ-42 | P1 | Real Git and Bazel fixture | Reverse dependencies select affected tests within the requested scope (begins running). | Two independent tests; one depends transitively on an edited source; clean comparison base. | 1. Edit the transitive input. 2. Run dry run and inspect tests. 3. Run the selected tests. | Dependent test selected; unrelated test excluded; ordinary Bazel executes the selected set. | Scripted pass, B2 real transitive graph and selected executable artifact. |
| BAZ-43 | P1 | Installed AL fixture | Changed paths include committed, staged, working-tree, and nonignored untracked changes (invoke). | TestAffectedBazelCLI committed, staged_reverted, source, untracked, and spaces cases. | 1. Run the cases. 2. Read changed_paths and invocation evidence. | Git-root-relative paths retain staged changes and names with spaces; untracked input cannot silently disappear. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-44 | P1 | Installed AL fixture | Uncertain mapping widens to the full requested scope (begins running). | TestAffectedBazelCLI deleted, renamed, build_file, bzl_file, untracked, outside_workspace, and external_scope cases. | 1. Run the cases. 2. Inspect selection, reasons, and tests. | full_scope reports explain the fallback and include the scoped independent test. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-45 | P1 | Real Git and Bazel fixture | Workspace and absolute target patterns bound selection (invoke). | Repository with two Bazel workspaces and distinct test scopes. | 1. Select one with –workspace and a scoped pattern. 2. Inspect workspace, scope, and tests. 3. Repeat from a subdirectory without –workspace. | Explicit selection and nearest-workspace discovery choose the intended workspace; tests do not expand outside the requested scope. | — |
| BAZ-46 | P1 | Installed AL fixture | Dry run reports selection without testing (while running). | TestAffectedBazelCLI dry_run case. | 1. Run the case. 2. Inspect JSON and recorded Bazel calls. | One JSON report with dry_run true; queries may run, but bazel test does not. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-47 | P1 | Installed AL fixture | Failed queries cannot supply partial accepted labels (exits immediately). | TestAffectedBazelCLI query_failure case prints partial query output before failing. | 1. Run the case. 2. Inspect stdout, status, and calls. | Nonzero result, no selection JSON, and no test invocation. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-48 | P1 | Installed AL fixture | Empty comparisons and selections skip tests (finishes). | TestAffectedBazelCLI unchanged and no_tests cases. | 1. Run both cases. 2. Inspect selection and calls. | unchanged reports no_changes without any Bazel call; an empty test list succeeds without bazel test. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-49 | P1 | Installed AL fixture and real Bazel workspace | Manual tags follow Bazel root selection and suite expansion (begins running). | TestAffectedBazelCLI manual_explicit, manual_suite_wildcard, manual_suite_explicit, and similar_manual_tag cases; repeat with real Bazel. | 1. Compare wildcard and exact test/suite scopes. 2. Inspect selected tests and test argv. 3. Include a manual-tagged suite member and similar tag names. | Wildcards exclude roots tagged exactly manual before suite expansion. Explicit tests/suites and members of eligible suites remain eligible; similar tag names are not manual. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-50 | P1 | Installed AL fixture | Selection JSON does not imply test success (finishes). | TestAffectedBazelCLI test_failure case. | 1. Run the case. 2. Parse stdout and inspect stderr/status. | Selection JSON remains on stdout; failed test output uses stderr and the command returns nonzero. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
| BAZ-51 | P1 | Installed AL fixture | Cancellation stops the active selection client without claiming completion (interrupts). | TestAffectedBazelCLI cancellation case with a waiting query helper. | 1. Wait for the fixture checkpoint. 2. Send SIGTERM through the fixture. 3. Inspect result and calls. | The client is cancelled, no selection success is emitted, and tests do not start. | Fixture pass, B2 affected-bazel-tests.json; real graph supplements selection cases. |
Inspect local diagnostics
BAZ-01–04, BAZ-08–09, BAZ-12, BAZ-14, BAZ-16, BAZ-18, BAZ-27, and BAZ-30
are retired with the removed Bazel forwarding command. Their IDs remain reserved;
C1’s forwarding records remain historical evidence, not checks of the current CLI.
| ID | P | Needs | Claim | Setup | Steps | Expected | Result |
|---|
| BAZ-05 | P1 | AL, doctor workspace | Doctor recognizes a task/run scratch path (simple case). | Valid workspace; scratch below out/task/run. | 1. Run doctor with both explicit paths. 2. Read scratch.namespaced. | Field is true. | Scripted pass, C1 doctor-namespaced. |
| BAZ-06 | P1 | AL, doctor workspace | Bare out is a conflicting scratch classification (finishes). | Valid workspace; select --task-scratch out. | 1. Run doctor. 2. Read scratch fields. | namespaced:false, reason:"conflict". | Scripted pass, C1 doctor-shared-scratch. |
| BAZ-07 | P1 | AL, doctor workspace | A conflicting scratch classification still exits zero (finishes). | Same setup as BAZ-06. | 1. Run doctor. 2. Capture status. | Exit 0. | Scripted pass, C1 doctor-shared-scratch. |
| BAZ-10 | P1 | AL, doctor workspace | Doctor reports declared configuration without exposing environment values (modifiers). | Synthetic AL_PRIVATE_MARKER; valid pin file. | 1. Run doctor. 2. Inspect rc fields and search output for marker. | Declared rc names are present; environment marker is absent. | — |
| BAZ-11 | P2 | AL, doctor workspace | Doctor needs no TTY (modifiers). | Valid workspace; closed stdin and captured stdout. | 1. Run doctor without terminal. 2. Parse stdout. | JSON report succeeds. | Scripted pass, C1 doctor-namespaced. |
| BAZ-13 | P2 | AL, controlled reader | Cancellation during a diagnostic read gives no prompt-stop guarantee (interrupts). | Doctor fixture with a controlled slow required-file read. | 1. Start report. 2. Send SIGINT before read finishes. 3. Release reader. | Record exit and report; do not assume immediate stop. | — |
| BAZ-15 | P2 | AL, controlled reader | SIGTERM before a complete diagnostic gives no completed-report claim (interrupts). | Controlled doctor read. | 1. Start report. 2. Send SIGTERM during required read. 3. Inspect captured output. | Record report completion or interruption; no early success is inferred. | — |
| BAZ-17 | P2 | TTY, controlled reader | Setup hangup has no AL recovery protocol (interrupts). | Controlled doctor read in disposable terminal. | 1. Start report. 2. Close terminal before read finishes. 3. Inspect process/output. | Record incomplete or completed observation; no recovery step is performed. | — |
| BAZ-19 | P2 | AL, doctor workspace | Doctor does not consume stdin (interrupts). | Valid workspace; stdin contains arbitrary synthetic text then closes. | 1. Run doctor. 2. Parse stdout. | Report is independent of stdin contents. | — |
| BAZ-20 | P2 | AL, closed pipe | Closed stdout can prevent complete doctor JSON (interrupts). | Parent closes report reader before completion. | 1. Run doctor into controlled pipe. 2. Close reader. 3. Record status/captured bytes. | No complete-output guarantee; record failure or termination. | — |
| BAZ-21 | P2 | AL, offline fixture | Doctor can begin from local inputs without network (interrupts). | Valid local workspace in already isolated offline environment. | 1. Run doctor. 2. Parse report. | Local report succeeds. | — |
| BAZ-22 | P2 | AL, controlled reader | Network loss does not create a doctor recovery step (interrupts). | Controlled local doctor read; isolated network already unavailable. | 1. Release the local read. 2. Inspect report. | Local report completes without service access. | — |
| BAZ-23 | P1 | AL, doctor workspace | Unreadable required pin input prevents a report (interrupts). | TestDoctorConfiguration/pins-missing and pins-invalid with a selected nondefault pin path. | 1. Run both fixture cases. 2. Capture streams and status. | Nonzero status and required-pin diagnostic; stdout contains no JSON report. | Fixture pass, C3 doctor-pins-missing.json and doctor-pins-invalid.json. |
| BAZ-24 | P2 | AL, failure injection | Doctor output failure can prevent a complete report (interrupts). | Report redirected to isolated limited fixture storage. | 1. Run doctor. 2. Trigger local output limit. 3. Inspect status/file. | Record incomplete output or write failure. | — |
| BAZ-25 | P2 | AL, two fixtures | Current PATH determines the executable at setup (interrupts). | Different private fixture first for each invocation. | 1. Run doctor separately with each PATH. 2. Compare bazel.executable. | Field follows selected PATH. | — |
| BAZ-26 | P2 | AL, controlled inputs | Doctor has no whole-file-set snapshot guarantee (interrupts). | Case-local pins and built-binary fixture can change independently. | 1. Run report while changing only fixture inputs. 2. Record field combinations or errors. | Record observations without assuming a common instant. | — |
| BAZ-28 | P2 | AL, doctor workspace | Doctor has no shared mutable report file (interrupts). | Valid workspace; two separately captured stdout streams. | 1. Run two doctor invocations. 2. Parse both captures. | Both reports are independently readable. | — |
| BAZ-29 | P2 | AL, controlled reader | Forced kill before report completion gives no completed observation (interrupts). | Controlled doctor read. | 1. Start report. 2. Send SIGKILL before read completes. 3. Inspect output. | No successful report completion is claimed. | — |
| BAZ-31 | P1 | AL, doctor workspace | A missing selected built binary means comparison unavailable (edge cases). | TestDoctorConfiguration/defaults and source-missing; absent default or explicitly selected comparison file. | 1. Run doctor. 2. Read source. | reason:"unavailable"; no current-install conclusion. | Fixture pass, C3 doctor-defaults.json and doctor-source-missing.json; C1 default observation retained. |
| BAZ-32 | P1 | AL, doctor workspace | Declared pin is not the resolved program’s reported version (edge cases). | Fixture Bazel would print a different version marker if run; valid explicit pin. | 1. Run doctor. 2. Read bazel.version and inspect fixture invocation marker. | Declared pin is reported; fixture is not invoked. | — |
| BAZ-33 | P2 | AL, doctor workspace | Doctor does not create the selected scratch path (while running). | Valid workspace; absent path out/task/new-run. | 1. Run doctor selecting it. 2. Check path existence. | Path remains absent. | — |
| BAZ-34 | P2 | AL | Doctor help avoids report collection (exits immediately). | Workspace without pin file. | 1. Run AL doctor --help. 2. Capture output/status. | Usage succeeds despite missing workspace pins. | — |
| BAZ-35 | P1 | AL, doctor workspace | Missing Bazel on PATH prevents doctor reporting (exits immediately). | Invoke AL by absolute path; PATH contains only an empty private directory. | 1. Run doctor selecting valid workspace. 2. Capture result. | Failure identifying missing Bazel executable. | — |
| BAZ-36 | P1 | Installed AL fixture | A configured pin-file path resolves against the selected workspace (invoke). | TestDoctorConfiguration/configured; pin file under config/. | 1. Run the fixture with a relative –bazelisk-config value. 2. Inspect reported version and archive digest. | The values come from the selected pin file. | Fixture pass, C3 doctor-configured.json. |
| BAZ-37 | P1 | Installed AL fixture | The selected source binary controls the installed comparison (begins running). | TestDoctorConfiguration/configured and source-stale; equal and different copied binaries. | 1. Run both cases with relative –source-binary. 2. Inspect source.binary and staleInstall. | The binary path is absolute; equal bytes report false and different bytes true. | Fixture pass, C3 doctor-configured.json and doctor-source-stale.json. |
| BAZ-38 | P1 | Installed AL fixture | Configured rc entries replace the default inventory without requiring those files (begins running). | TestDoctorConfiguration/configured; two absent rc paths, one relative and one absolute. | 1. Run with repeated –rc-file. 2. Read rcFiles. | The two entries retain order and are reported relative to the workspace; absent files do not fail reporting. | Fixture pass, C3 doctor-configured.json. |
| BAZ-39 | P2 | Installed AL fixture | An explicitly empty rc path is refused (exits immediately). | TestDoctorConfiguration/rc-empty. | 1. Pass –rc-file with an empty value. 2. Capture both streams and status. | Nonzero status, no JSON report, and a nonempty-path diagnostic. | Fixture pass, C3 doctor-rc-empty.json. |
| BAZ-40 | P2 | Installed AL fixture | Default rc inventory contains only .bazelrc (invoke). | TestDoctorConfiguration/defaults; no –rc-file flags. | 1. Run the fixture. 2. Read rcFiles. | The list is exactly [.bazelrc], without invented repository-specific imports. | Fixture pass, C3 doctor-defaults.json. |
Not checkable by hand:
- The configured rc inventory is a declaration. A matching list in one report cannot
establish which files a real Bazel process will load.
- Bazel’s network, server coordination, build consistency, and cancellation
belong to its existing validation and operator procedures.
- Timing races between doctor reads do not establish a
universal timing guarantee. Record limitations rather than promoting a fast
successful sample to such a guarantee.
Source revision for this checklist is the AL documentation baseline.
2.3.2.10.2 - Verification: delivery
Use the verification protocol and the revision identified by the
delivery feature.
The rebase and selected-base rows cite the R1/R2 fixture passes in the protocol;
other results remain unrun for this documentation pass. Fixture observations are
automated evidence, not a manual production or interactive-terminal pass.
For a named test, run from the projects/al workspace with
bazel test //internal/delivery:go_test --test_arg=-test.run=^TEST_NAME$ --test_output=all, replacing TEST_NAME with the
exact name in the row. Keep the test log and any undeclared output artifact under
the pass evidence directory. Read the named fixture before running it so its
assertions, controlled environment, and coverage limits are clear. Do not infer
that a passing fixture exercised live GitHub timing.
Rows labeled instrumented fixture require a disposable Git/forge setup with
the stated pause or failure hook. Existing tests provide its reference behavior,
but these rows are blocked until that setup exists; do not substitute the real
repository or forge. TTY rows require a controlling terminal. No row authorizes
a live push, review comment, or credential change.
Delivery workflow
DEL-10, DEL-13–22, and DEL-26 describe retired target suggestions, structured
check plans, result ledgers, and combined validation/publication helpers. Their
IDs remain reserved; historical evidence does not verify the current workflow.
The ordinary-check workflow is covered by DEL-58–63 below.
| ID | P | Device | Claim | Setup | Steps | Expected | Result |
|---|
| DEL-01 | P1 | Local CLI | Provider output separates adapter and transport support (invoke). | Disposable repository with SSH origin identifying GitHub; no remote contact needed. | 1. Run al delivery --repository FIXTURE provider. 2. Parse stdout as JSON. | Adapter availability and SSH transport availability are separate fields. | — |
| DEL-02 | P1 | Local CLI | Provider output does not print endpoint URLs (invoke). | DEL-01 fixture with a known synthetic remote string. | 1. Capture provider stdout and stderr. 2. Search for the complete configured remote string. | The endpoint string is absent from the sanitized report. | — |
| DEL-03 | P1 | Local CLI | HTTPS does not silently become SSH (invoke). | Disposable repository with an HTTPS GitHub origin. | 1. Run provider. 2. Read its transport fields. 3. Read the configured remote afterward. | Delivery transport is unavailable and the remote remains HTTPS. | — |
| DEL-04 | P2 | Local CLI | Help does not prepare or publish a candidate (exits immediately). | Clean disposable repository; record HEAD and refs. | 1. Run al delivery prepare --help. 2. Compare HEAD and refs. | Help is printed; recorded Git state is unchanged. | — |
| DEL-05 | P1 | Existing fixture | Scope includes the complete existing feature diff (begins running). | TestPreparePathConstrainsExistingAggregateDiff. | 1. Run the named test. 2. Inspect its omitted-path refusal. | Preparation refuses a requested scope that excludes existing aggregate changes. | — |
| DEL-06 | P1 | Existing fixture | Explicit tracked deletions can be staged (begins running). | TestPrepareStagesExplicitTrackedDeletion. | 1. Run the named test. 2. Inspect the candidate tree assertion. | The explicitly owned deletion is included in the candidate. | — |
| DEL-07 | P1 | Existing fixture | Consolidation requires explicit exact-head selection (begins running). | TestPrepareRefusesMultiCommitRangeWithoutExactConsolidation. | 1. Run the named test. 2. Inspect the refusal cases. | An unselected or stale multi-commit replacement is refused. | — |
| DEL-08 | P1 | Existing fixture | An eligible explicitly selected range becomes one candidate (begins running). | TestPrepareConsolidatesExactOwnedLinearRange. | 1. Run the named test. 2. Inspect the resulting range assertions. | The prepared range is one aggregate commit preserving the owned content. | — |
| DEL-09 | P1 | Existing fixture | Index preparation freezes exact aggregate paths (begins running). | TestPreparedIndexReceiptFreezesExactAggregatePaths. | 1. Run the named test. 2. Inspect receipt scope assertions. | The receipt carries immutable exact aggregate paths. | — |
| DEL-11 | P1 | Existing fixture | Direct rebase preserves remote publication while updating the local candidate (begins running). | TestRebasePreservesRemoteUntilPublication, with an advanced base and both existing and absent remote feature refs. | 1. Run both subcases. 2. Compare local heads, remote refs, leases, and PR state. | Status is rebased, pushed is false, the new head includes base changes, and remote/PR state is unchanged. | Fixture pass, R1 TestRebasePreservesRemoteUntilPublication. |
| DEL-12 | P1 | Existing fixture | Direct rebase refuses a dirty worktree (begins running). | TestRebaseRequiresCleanWorktree. | 1. Run the named test. 2. Inspect its refusal and retained files. | Rebase preserves HEAD and the tracked and untracked edits. | Fixture pass, R1 TestRebaseRequiresCleanWorktree. |
| DEL-23 | P1 | Existing fixture | Exact remote feature progress is protected (while running). | TestPublishReceiptRejectsChangedRemoteHeadLease. | 1. Run the named test. 2. Inspect the changed remote head refusal. | A stale lease cannot replace the newly observed remote head. | — |
| DEL-24 | P1 | Existing fixture | A PR identity replacement is refused (while running). | TestPublishReceiptRejectsReplacementPullRequest. | 1. Run the named test. 2. Inspect identity checks. | A replacement PR is not silently adopted. | — |
| DEL-25 | P1 | Existing fixture | Verification preserves changed PR metadata (while running). | TestVerifyRefusesPullRequestMetadataEditAfterInitialInspection. | 1. Run the named test. 2. Inspect the mutation/refusal boundary. | Changed metadata causes a refusal instead of being overwritten. | — |
| DEL-27 | P1 | Existing fixture | A final read failure retains known publication evidence (finishes). | TestPublicationRetainsEvidenceAfterReviewFailure; push and PR synchronization succeed before the final review read fails. | 1. Run the named fixture. 2. Inspect publication-review-recovery.json and the remote-state assertions. | The pending report retains candidate and PR identity with verified false; later verification observes the completed publication without repeating it. | Fixture pass, D1 publication-review-recovery.json; working-tree candidate. |
| DEL-28 | P1 | Existing fixture | Review inspection covers all bounded review categories (review). | TestGitHubInspectReviewsReadsEveryReviewCategory. | 1. Run the named test. 2. Inspect returned reviews, threads, comments, and requests. | Each category appears without implying a review job completed. | — |
| DEL-29 | P1 | Existing fixture | Address recovery does not duplicate a confirmed reply (review). | TestReviewAddressPublishedCandidateAndRecovery. | 1. Run the named test. 2. Inspect the retained review-address.json artifact when available. | The restored unexpired attempt resolves the thread with only one reply. | — |
| DEL-30 | P1 | Existing fixture | Unknown reply outcome blocks automatic reposting (review). | TestReviewAddressRefusesDuplicateAfterUnknownReplyOutcome. | 1. Run the named test. 2. Inspect the reply-call count. | The next attempt does not post a second reply. | — |
| DEL-31 | P1 | Existing fixture | Address refuses changed candidate or reply inputs (review). | TestReviewAddressRefusesChangedInputs. | 1. Run the named test. 2. Inspect dirty, stale, expired, and altered-evidence cases. | Changed authority or evidence does not resolve the thread. | — |
| DEL-32 | P2 | Local CLI | Repository selection changes the inspected local target (modifiers). | Two disposable repositories with different synthetic forge identities. | 1. Run provider with each --repository path. 2. Compare sanitized identity fields. | Each report identifies its selected repository. | — |
| DEL-33 | P2 | Local CLI | Structured command reports are separate from errors (modifiers). | Missing disposable repository path; stdout/stderr captured separately. | 1. Run provider with the missing path. 2. Inspect both streams and exit status. | Nonzero status and stderr diagnostic; stdout is not a successful JSON report. | — |
| DEL-34 | P1 | Instrumented fixture | Missing forge execution prerequisites fail rather than starting plugins (modifiers). | Instrumented local CLI with no valid forge executable and a synthetic configuration file. | 1. Invoke inspect using the absent executable path. 2. Observe the failure boundary and child process log. | The selected executable fails; no AL credential plugin startup is implied. | — |
| DEL-35 | P1 | Instrumented fixture | Cancellation before a selected operation does not establish readiness (interrupts). | AL paused before the first subprocess; fresh receipt path. | 1. Deliver SIGINT once before releasing the pause. 2. Capture status and receipt state. 3. Repeat from a fresh fixture with two SIGINT signals. | Record cancellation state; no completed operation or publication is inferred from either run. | — |
| DEL-36 | P1 | Instrumented fixture / TTY | Ctrl+C during work can leave earlier durable state (interrupts). | Disposable workflow paused after candidate creation and before a slow next subprocess. | 1. Press Ctrl+C. 2. Read HEAD and the receipt. 3. Repeat with two presses in a fresh fixture. | Earlier candidate/evidence can remain; a second press is not assumed to force rollback. | — |
| DEL-37 | P1 | Instrumented fixture | SIGTERM before work uses cancellation (interrupts). | Fresh invocation paused before its first subprocess. | 1. Deliver SIGTERM. 2. Capture exit and evidence. | No completed operation is inferred; cancellation is reported where observed. | — |
| DEL-38 | P1 | Instrumented fixture | SIGTERM during work does not undo the complete workflow (interrupts). | Disposable workflow paused after a confirmed local commit. | 1. Deliver SIGTERM. 2. Inspect HEAD and evidence. | The already created commit can remain; no rollback guarantee is claimed. | — |
| DEL-39 | P2 | TTY fixture | Terminal loss before work has no dedicated AL recovery (interrupts). | Fresh process in a disposable controlling terminal, paused before work. | 1. Close the terminal. 2. Inspect process and files from another terminal. | Record OS termination behavior and existing state; no AL recovery report is required. | — |
| DEL-40 | P1 | TTY fixture | Terminal loss during remote work can hide the outcome (interrupts). | Disposable forge update acknowledged internally but final report paused. | 1. Close the terminal. 2. Inspect fixture remote state and receipt from another terminal. | The mutation can exist without visible completion output. | — |
| DEL-41 | P2 | Instrumented fixture | Closed stdin is not publication approval input (interrupts). | Prepared disposable candidate with a known publication. | 1. Close stdin. 2. Invoke receipt-bound verify. 3. Inspect forge state. | Verification does not push; stdin closure does not select a publication mutation. | — |
| DEL-42 | P1 | Instrumented fixture | Broken stdout can occur after a durable operation (interrupts). | Disposable candidate preparation paused immediately before final JSON writing. | 1. Close the stdout reader. 2. Release the pause. 3. Inspect HEAD and receipt. | Preserve any committed candidate even when its report is lost or writing fails. | — |
| DEL-43 | P2 | Local CLI / offline | Provider detection is local (interrupts). | DEL-01 fixture with external network blocked. | 1. Run provider. 2. Capture its result. | Local sanitized provider detection still succeeds. | — |
| DEL-44 | P1 | Instrumented fixture | Connection loss during publication leaves an observable recovery boundary (interrupts). | Disposable forge accepts a mutation but drops its response. | 1. Invoke receipt-bound publication. 2. Restore fixture reads. 3. Run receipt-bound verify. | Verification reports the observed postcondition without repeating the push or PR mutation. | — |
| DEL-45 | P1 | Local fixture | Inaccessible required input fails before its use (interrupts). | Disposable repository with a missing message file and otherwise valid scope. | 1. Invoke prepare with that message path. 2. Inspect HEAD and diagnostic. | Required input error; no successful preparation is reported. | — |
| DEL-46 | P1 | Instrumented filesystem fixture | Evidence failure can follow candidate creation (interrupts). | Receipt installation fault injected after the candidate write. | 1. Fail the evidence write. 2. Capture the command result. 3. Inspect HEAD and receipt bytes. | Record remaining candidate and any uncertainty; do not infer that failure removed the commit. | — |
| DEL-47 | P1 | Existing fixture | Stale input is refused before remote mutation (interrupts). | TestPublishRefusesChangedReceiptBeforeRemoteMutation. | 1. Run the named test. 2. Inspect the remote-mutation assertion. | Changed receipt evidence prevents the remote mutation. | — |
| DEL-48 | P1 | Existing fixture | Late task-scope edits are rechecked (interrupts). | TestPublishRechecksPreparedScopeAfterFinalForgeRead. | 1. Run the named test. 2. Inspect the final-scope refusal. | Publication refuses the late edit rather than using stale source. | — |
| DEL-49 | P1 | Existing fixture | Concurrent receipt transitions serialize (interrupts). | TestReceiptLockSerializesOverlappingTransition. | 1. Run the named test. 2. Inspect entry ordering. | The second cooperating transition does not overlap the first. | — |
| DEL-50 | P1 | Existing fixture | Lock-ignoring writers are outside the receipt lock guarantee (interrupts). | TestReceiptComparisonDoesNotExcludeLockIgnoringWriter. | 1. Run the named test. 2. Read its race observation. | The result does not claim exclusion of a writer that ignores the lock. | — |
| DEL-51 | P1 | Instrumented fixture | Forced kill before work proves no completion (interrupts). | Fresh process paused before any operation. | 1. Send SIGKILL. 2. Inspect process and evidence. | No application completion report or cleanup is expected. | — |
| DEL-52 | P1 | Instrumented fixture | Forced kill during an attempt can prevent evidence finalization (interrupts). | Disposable workflow paused after an attempted forge write and before final evidence. | 1. Send SIGKILL. 2. Inspect remote state and retained attempt evidence. 3. Resume verification only after diagnosis. | Partial evidence and completed remote state can coexist; do not delete evidence to force a retry. | — |
| DEL-53 | P1 | Existing fixture | Identical base entries can shrink rebase scope safely (edge cases). | TestPublishRebaseDropsOnlyPathsIdenticalInAdvancedBase. | 1. Run the named test. 2. Inspect accepted and refused scope changes. | Only the exact identical-entry reduction is accepted. | — |
| DEL-54 | P2 | Instrumented fixture | A message-only amendment changes commit identity (edge cases). | Prepared disposable candidate and revised aggregate message. | 1. Record old head/tree. 2. Prepare the message-only amendment. 3. Compare returned head/tree. | The tree remains identical while the candidate OID changes. | — |
| DEL-55 | P1 | Existing fixture | An already-based branch is not published by direct rebase (begins running). | TestRebaseAlreadyBasedPreservesRemote. | 1. Run the named test. 2. Inspect the report and absent remote feature ref. | Status is already_based, pushed is false, local HEAD is unchanged, and no remote branch is created. | Fixture pass, R1 TestRebaseAlreadyBasedPreservesRemote. |
| DEL-56 | P2 | Delivery fixture | Direct rebase reports the required preparation, ordinary checks, and publication steps (begins running). | Eligible single-commit branch with an advanced base. | 1. Run direct rebase. 2. Read next_action from the JSON report. | The next action directs preparation of the rebased candidate, ordinary checks, then explicit publication. | — |
| DEL-57 | P1 | Existing fixture | Inspection bases rebase decisions on the selected branch (invoke). | TestDeliveryInspectionUsesSelectedBase; explicit release base or existing PR base. | 1. Advance unrelated trunk and inspect. 2. Advance the selected release base and inspect again. | Unrelated advancement causes no stale-base refusal or rebase request; selected-base advancement sets needs_rebase while local HEAD stays unchanged. | Fixture pass, R2 selected-base-{false,true}.json and selected-base-advanced-{false,true}.json. |
| DEL-58 | P1 | Isolated Git/forge fixture | Preparation performs only Git preparation (begins running). | Valid task scope and message; Bazel absent from fixture PATH; standalone AL. | 1. Run prepare with its Git options. 2. Read the candidate and receipt. 3. Inspect subprocess observations. | Candidate and preparation receipt are created without launching Bazel or requiring a check plan. | — |
| DEL-59 | P1 | Isolated Git/forge fixture | Publication uses the prepared receipt without a validation ledger (while running). | Exact prepared candidate, matching clean state and remote expectations; no check-plan or result files. | 1. Run explicitly authorized fixture publish --receipt-file RECEIPT. 2. Inspect remote ref and PR state. | Publication uses the receipt’s candidate and current matching HEAD; no validated-head flag or validation log is required. | Fixture pass, D1 source-publication.json; working-tree candidate. |
| DEL-60 | P1 | Isolated Git/forge fixture | Changed candidate or prepared scope refuses publication (while running). | Separate prepared cases with a changed HEAD, staged change, and unstaged edit in task scope. | 1. Run receipt-bound publish in each case. 2. Inspect diagnostic and remote state. | Mismatched candidate or dirty prepared inputs refuse publication before remote mutation. | — |
| DEL-61 | P1 | Isolated Git/forge fixture | An advanced base produces a rebased candidate requiring checks (while running). | Prepared clean feature candidate; advance fixture base without conflicts. | 1. Publish using the receipt. 2. Read the report and updated receipt. 3. Compare local candidate and remote feature ref. | Nonzero result with checks_required; receipt identifies the rebased head/tree and remote feature publication is unchanged. | — |
| DEL-62 | P1 | Isolated Git/forge fixture | The updated receipt can publish after ordinary checks (while running). | Successful DEL-61 rebase; source and base remain unchanged. | 1. Run the fixture’s ordinary Bazel checks. 2. Invoke publish with the same receipt. 3. Inspect head and publication. | No additional prepare or commit rewrite is needed; the rebased candidate is published under its exact lease. | — |
| DEL-63 | P1 | Isolated Git/forge fixture | Review addressing uses the clean prepared candidate and verified publication (review). | Published prepared candidate, controlled unresolved thread, authorized reply file; no validation logs. | 1. Run review address with the preparation receipt and thread. 2. Inspect reply and resolution evidence. 3. Repeat from a fresh case with dirty inputs. | The clean exact published case can reply and resolve without check logs; the dirty case is refused. | — |
Not checkable by hand
Check selection and adequacy remain the operator’s responsibility. AL does not
inspect ordinary Bazel results; successful publication is not evidence that
tests ran or passed.
A finite pass cannot prove absence of all GitHub-side races or moderation
events omitted from its bounded projection. The documented boundary is a
limitation, not a claim to be certified by one successful mutation.
Unimplemented pause/failure hooks above are verification setup work, not
product defects. Record those rows as blocked when attempting a pass without
the required setup; do not mark them passed from source reading.
2.3.2.10.3 - Verification: foundations
Use the setups in the protocol. AL denotes the absolute path of
the source-built executable; SCRATCH is an isolated task directory. Inspect
stdout and stderr separately and retain both.
Invocation
| ID | P | Device | Claim | Setup | Steps | Expected | Result |
|---|
| INV-01 | P1 | Local | Direct command families (entry). | No config. | 1. Run AL --help. | All seven documented families appear. | —; B1 records the earlier six-family CLI |
| INV-02 | P1 | Local | Unknown commands fail (entry). | No config. | 1. Run AL unknown-command. | Nonzero exit; diagnostic on stderr. | pass (scripted: unknown-command) |
| INV-03 | P2 | Local | Leaf help is discoverable (entry). | No config. | 1. Run AL help version show. | Help names repository and format options. | — |
| INV-04 | P1 | Local | No universal JSON flag (entry). | No config. | 1. Run AL --json. | Unsupported flag fails; no command work. | — |
| INV-05 | P1 | Interrupt fixture | SIGINT requests cancellation (signals). | Slow version Git helper. | 1. Start inspection. 2. Send one SIGINT to AL. 3. Observe helper exit. | Invocation fails; helper is stopped. | — |
| INV-06 | P1 | Interrupt fixture | SIGTERM requests cancellation (signals). | Slow version Git helper. | 1. Start inspection. 2. Send SIGTERM to AL. 3. Observe helper exit. | Invocation fails; helper is stopped. | — |
| INV-07 | P2 | TTY | Git can prompt in foreground (signals). | Controlling-terminal fixture in cmd/al/lifecycle_e2e_test.go. | 1. Start terminal fixture. 2. Supply its synthetic prompt input. 3. Observe restored foreground owner. | Git receives input; terminal returns to caller. | — |
| INV-08 | P2 | Interrupt fixture | Repeated signals have no promised escalation (signals). | Slow cleanup fixture. | 1. Send SIGINT twice during cleanup. 2. Record timing and remaining children. | Characterize behavior; do not assume second signal is force kill. | — |
| INV-09 | P2 | Interrupt fixture | SIGHUP/pipe closure have no rollback promise (signals). | Disposable slow writer. | 1. Separately close terminal and stdout pipe. 2. Inspect written state. | Record partial state and exit; no rollback claim. | — |
State
| ID | P | Device | Claim | Setup | Steps | Expected | Result |
|---|
| STATE-01 | P1 | Git | Source publication is separate (boundaries). | Scratch Git and bare remote. | 1. Publish source refs. 2. Inspect artifact destination fixture. | Source refs exist; artifact publication was not invoked. | pass (scripted: version-publish-local; no artifact destination configured) |
| STATE-02 | P1 | Local | Bundle is local state (boundaries). | One generated bundle. | 1. Read manifest and files. 2. Inspect command arguments. | Payload exists locally; no publication was selected. | pass (scripted: bundle-generate) |
| STATE-03 | P1 | SSH fixture | Upload does not activate (boundaries). | Inactive version, artifact publication. | 1. Run al release publish. 2. Read current link. | Publication exists; current selection unchanged. | — |
| STATE-04 | P1 | SSH fixture | Started step is unknown (receipts). | Receipt and blocked transport. | 1. Start upload. 2. Read receipt after checkpoint but before acknowledgment. | Step unknown; invocation running. | — |
| STATE-05 | P1 | SSH fixture | Completed operations survive a later invocation failure (receipts). | Upload succeeds; a separate website extraction has an injected failure. | 1. Publish with one receipt. 2. Extract with a new receipt. 3. Read both after failure. | Upload remains completed; extraction is unknown/incomplete in its own receipt. | — |
| STATE-06 | P1 | Interrupt fixture | Killed invocation can leave running evidence (receipts). | Blocked artifact step after checkpoint. | 1. Send SIGKILL. 2. Read last persisted receipt. | Running/unknown evidence can remain; remote state needs inspection. | — |
| STATE-07 | P1 | Git | Linked worktrees share source lock (recovery). | Fixture Git with second linked worktree. | 1. Hold source operation lock. 2. Attempt second publication. | Second operation cannot acquire lock. | — |
| STATE-08 | P2 | Local | Receipt formats are distinct (receipts). | Source-ref and artifact fixture receipts. | 1. Compare schemas and fields. | Source-ref evidence is not a step journal or delivery receipt. | — |
| STATE-09 | P1 | Delivery fixture | Direct rebase updates only local candidate state (summary). | R1 rebase fixtures with existing and absent remote feature refs. | 1. Run TestRebasePreservesRemoteUntilPublication. 2. Compare local head, remote ref, and PR state. | The local candidate changes; remote publication does not. | Fixture pass, R1 TestRebasePreservesRemoteUntilPublication. |
Not checkable by hand: universal absence of races and externally introduced state; source review and failure-injection fixtures remain necessary.
2.3.2.10.4 - Verification: releases
Use only the isolated setups in the protocol. AL is an absolute
binary path. Define GEN as AL release generate --project projects/example --version_file STATUS --add_file PAYLOAD --output_dir OUTPUT, replacing uppercase
paths with absolute scratch paths. A development STATUS contains
STABLE_VERSION 0.0.0-dev and STABLE_VERSION_CHANNEL development; a release
status comes from the isolated Git fixture’s version bazel-status output.
PUB means the fixture’s AL release publish --release_dir BUNDLE --environment local --ssh_host FIXTURE --ssh_root ROOT with the fixture SSH/rsync executables
and trust inputs. ROOT is disposable fixture content, never a live host. Use a
fresh receipt path for each attempt. Existing fixtures own transport setup;
reuse them rather than weakening host trust. EXTRACT and ACTIVATE use those
same fixture selectors with AL release website extract and
AL release website activate; only EXTRACT accepts --site_archive.
PLAN and INSPECT use those same fixture selectors with release plan and
release inspect. Planning is an offline metadata preview; inspection reads the
fixture’s current state. Neither authorizes a publication. Preserve the original
scripted observations when adding later fixture results.
Later planning/inspection rows cite O1, the complete release-package fixture
pass recorded in the protocol. Its numbered JSON
reports are retained under out/unify-release-versioning/release-observation/final-evidence/.
The fixture uses the built CLI, synthetic payloads, and controlled SSH transport;
it is not a live-destination or manual-terminal pass. W1 records the later
nested website-command fixtures, with current preview reports under
out/unify-release-versioning/api-naming/website-evidence/. Earlier observations
retain their original command surface. Unrecorded rows remain —.
Generate a project bundle
| ID | P | Device | Claim | Setup | Steps | Expected | Result |
|---|
| BUNDLE-01 | P1 | Local | Manifest describes copied bytes (finish). | Release status and one payload. | 1. Run GEN. 2. Hash copied payload. 3. Compare manifest name, size and digest. | Exact identity and matching bytes. | pass (scripted: bundle-generate; independent SHA-256) |
| BUNDLE-02 | P1 | Local | Occupied output is refused (short path). | Previously generated output. | 1. Run GEN again. | Nonzero; existing bundle not overwritten. | pass (scripted: bundle-occupied-output) |
| BUNDLE-03 | P1 | Local | Missing release source is refused (begin). | Concrete version but no commit/tree state. | 1. Run GEN with that status and new output. | Nonzero; no completed bundle manifest. | pass (scripted: bundle-missing-source) |
| BUNDLE-04 | P2 | Local | Repeated payload flags select several files (flags). | Two distinct payload basenames. | 1. Add second --add_file. 2. Run GEN. 3. Inspect manifest. | Both files copied and described. | — |
| BUNDLE-05 | P2 | Local | Formatting/mode flags affect output (flags). | Fresh bundle. | 1. Set --indent to two spaces and --output_file_mode 0600. 2. Inspect manifest. | Requested JSON layout and manifest permissions. | — |
| BUNDLE-06 | P1 | Local | Basename collisions fail (edge cases). | Two different directories containing same basename. | 1. Add both files. 2. Run GEN. | Nonzero; no completed manifest. | — |
| BUNDLE-07 | P1 | Local | Empty bundles fail (short path). | Valid status without payload. | 1. Remove --add_file. 2. Run GEN. | Nonzero; no complete bundle. | — |
| BUNDLE-08 | P2 | Local | No plugin startup (systems). | No plugin configuration. | 1. Generate with minimal environment. | Bundle generation succeeds without plugin launch. | pass (scripted: bundle-generate) |
| BUNDLE-09 | P2 | Interrupt fixture | Ctrl+C once or twice, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Send SIGINT, then repeat in a separate attempt with two SIGINTs. 2. Inspect manifest and payloads. | Signal cancellation is requested; record whether copying stops promptly. | — |
| BUNDLE-10 | P2 | Interrupt fixture | Ctrl+C once or twice, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Send SIGINT, then repeat in a separate attempt with two SIGINTs. 2. Inspect manifest and payloads. | Signal cancellation is requested; record whether copying stops promptly. | — |
| BUNDLE-11 | P2 | Interrupt fixture | SIGTERM, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Send SIGTERM to the recorded AL PID. 2. Inspect manifest and payloads. | No transaction-wide rollback is assumed. | — |
| BUNDLE-12 | P2 | Interrupt fixture | SIGTERM, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Send SIGTERM to the recorded AL PID. 2. Inspect manifest and payloads. | No transaction-wide rollback is assumed. | — |
| BUNDLE-13 | P2 | Interrupt fixture | Terminal closed (SIGHUP), before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Send SIGHUP to the disposable process. 2. Inspect manifest and payloads. | No AL recovery handler; record surviving output. | — |
| BUNDLE-14 | P2 | Interrupt fixture | Terminal closed (SIGHUP), during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Send SIGHUP to the disposable process. 2. Inspect manifest and payloads. | No AL recovery handler; record surviving output. | — |
| BUNDLE-15 | P2 | Interrupt fixture | Input or output pipe closes, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Close the diagnostic pipe; keep named payload intact. 2. Inspect manifest and payloads. | Named payload remains independent of stdin; record exit and files. | — |
| BUNDLE-16 | P2 | Interrupt fixture | Input or output pipe closes, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Close the diagnostic pipe; keep named payload intact. 2. Inspect manifest and payloads. | Named payload remains independent of stdin; record exit and files. | — |
| BUNDLE-17 | P2 | Interrupt fixture | Disk full or file inaccessible, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Use a fixture-controlled failing file or filesystem. 2. Inspect manifest and payloads. | Error is visible; during copying partial files may remain. | — |
| BUNDLE-18 | P2 | Interrupt fixture | Disk full or file inaccessible, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Use a fixture-controlled failing file or filesystem. 2. Inspect manifest and payloads. | Error is visible; during copying partial files may remain. | — |
| BUNDLE-19 | P2 | Interrupt fixture | Required state changes, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Change the fixture input at the controlled checkpoint. 2. Inspect manifest and payloads. | Record result; there is no snapshot guarantee. | — |
| BUNDLE-20 | P2 | Interrupt fixture | Required state changes, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Change the fixture input at the controlled checkpoint. 2. Inspect manifest and payloads. | Record result; there is no snapshot guarantee. | — |
| BUNDLE-21 | P2 | Interrupt fixture | Concurrent invocation, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Start a second GEN sharing OUTPUT. 2. Inspect manifest and payloads. | Record both exits and output; no whole-bundle lock guarantee. | — |
| BUNDLE-22 | P2 | Interrupt fixture | Concurrent invocation, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Start a second GEN sharing OUTPUT. 2. Inspect manifest and payloads. | Record both exits and output; no whole-bundle lock guarantee. | — |
| BUNDLE-23 | P2 | Interrupt fixture | Forced kill, before work (interrupt). | GEN held at a pre-copy fixture checkpoint. | 1. Send SIGKILL to the disposable AL PID. 2. Inspect manifest and payloads. | No completed bundle is implied; inspect partial files. | — |
| BUNDLE-24 | P2 | Interrupt fixture | Forced kill, during work (interrupt). | GEN held at a mid-copy fixture checkpoint. | 1. Send SIGKILL to the disposable AL PID. 2. Inspect manifest and payloads. | No completed bundle is implied; inspect partial files. | — |
Network loss has no ordinary local-input interaction. Snapshot/race absence and prompt cancellation cannot be established from a single observation.
Publication
| ID | P | Device | Claim | Setup | Steps | Expected | Result |
|---|
| PUB-01 | P1 | SSH fixture | New identity becomes complete (begin). | Valid clean bundle; absent destination identity. | 1. Run PUB. 2. Inspect public manifest/file set/digests. | Complete verified identity; no public files layer. | — |
| PUB-02 | P1 | SSH fixture | Identical retry skips payload reads (begin). | Existing matching publication; remove local payloads. | 1. Run PUB again. 2. Inspect transport calls. | Success without payload transfer. | — |
| PUB-03 | P1 | SSH fixture | Conflicting bytes refuse overwrite (begin). | Existing publication; different candidate bytes. | 1. Run PUB. 2. Compare original remote hashes. | Failure; original publication unchanged. | — |
| PUB-04 | P1 | SSH fixture | Corrupt/extra remote files fail retry (edge cases). | Disposable publication. | 1. Add an extra file; retry. 2. Reset fixture, corrupt payload; retry. | Both retries fail verification. | — |
| PUB-05 | P1 | SSH fixture | Upload alone does not extract (while running). | Archive payload; absent retained site. | 1. Run default PUB. 2. Inspect site root. | Published archive exists; no extracted site. | — |
| PUB-06 | P1 | SSH fixture | Website extraction then activation selects the site (while running). | Published valid site archive with root index.html. | 1. Run EXTRACT. 2. Inspect retained site. 3. Run ACTIVATE. | Retained binding matches; current points to selected site. | — |
| PUB-07 | P1 | SSH fixture | Rollback retains versions (while running). | Two published/extracted versions. | 1. Activate second. 2. Activate first. 3. Inspect both. | Both retained; current returns to first. | — |
| PUB-08 | P1 | SSH fixture | Active deletion is refused (while running). | Selected website. | 1. Run release delete with same bundle/destination. 2. Inspect both trees. | Failure before removing content. | — |
| PUB-09 | P1 | SSH fixture | Delete permits different republish (finish). | Inactive release. | 1. Delete. 2. Publish same version with different bytes. 3. Inspect Git tags. | New bytes accepted; source refs remain. | — |
| PUB-10 | P2 | SSH fixture | Absent deletion succeeds (finish). | Already deleted identity. | 1. Repeat deletion. | Success; no restoration state required. | — |
| PUB-11 | P1 | SSH fixture | Unsafe ancestry/mounts refuse removal (edge cases). | Mount namespace fixture. | 1. Test symlink ancestry and bind-mounted file separately. 2. Attempt deletion. | Neither release tree removed. | — |
| PUB-12 | P1 | SSH fixture | Selection follows flags (invoke). | Manifest with two environment assignments. | 1. Publish selected environment without host override. 2. Reset and use explicit host. | First selects matching items; override selects all. | — |
| PUB-14 | P1 | Local | OCI publication refuses (short path). | Legacy OCI metadata. | 1. Invoke publish without SSH selection. | Immutability refusal; no registry push. | — |
| PUB-15 | P1 | SSH fixture | Separate operations retain their own evidence (while running). | Upload succeeds; subsequent extraction has an injected failure. | 1. Run PUB with one receipt. 2. Run EXTRACT with a new receipt. 3. Read both receipts and stdout. | Upload remains completed in its receipt; extraction has an unknown step and incomplete status in its own receipt. | — |
| PUB-16 | P2 | SSH fixture | Trust/authentication are noninteractive (modifiers). | Wrong known-host entry. | 1. Run PUB with that trust file. | Failure without accepting a new host key interactively. | — |
| PUB-17 | P1 | SSH fixture | Ctrl+C once or twice, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Send SIGINT; test repeated SIGINT separately. 2. Compare receipt, publication, staging and current. | Preserve completed steps; inspect unknown state instead of assuming rollback. | — |
| PUB-18 | P1 | SSH fixture | Ctrl+C once or twice, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Send SIGINT; test repeated SIGINT separately. 2. Compare receipt, publication, staging and current. | Preserve completed steps; inspect unknown state instead of assuming rollback. | — |
| PUB-19 | P1 | SSH fixture | SIGTERM, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Send SIGTERM to the recorded process. 2. Compare receipt, publication, staging and current. | Cancellation can leave completed and unknown steps. | — |
| PUB-20 | P1 | SSH fixture | SIGTERM, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Send SIGTERM to the recorded process. 2. Compare receipt, publication, staging and current. | Cancellation can leave completed and unknown steps. | — |
| PUB-21 | P1 | SSH fixture | Terminal closed (SIGHUP), before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Send SIGHUP to the isolated process. 2. Compare receipt, publication, staging and current. | Inspect persisted receipt and remote content; no special recovery. | — |
| PUB-22 | P1 | SSH fixture | Terminal closed (SIGHUP), during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Send SIGHUP to the isolated process. 2. Compare receipt, publication, staging and current. | Inspect persisted receipt and remote content; no special recovery. | — |
| PUB-23 | P1 | SSH fixture | Input or output pipe closes, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Close output pipe while transport is controlled. 2. Compare receipt, publication, staging and current. | Lost completion output does not establish remote failure. | — |
| PUB-24 | P1 | SSH fixture | Input or output pipe closes, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Close output pipe while transport is controlled. 2. Compare receipt, publication, staging and current. | Lost completion output does not establish remote failure. | — |
| PUB-25 | P1 | SSH fixture | Network lost, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Fail the fixture transport before send or after remote completion. 2. Compare receipt, publication, staging and current. | Before effects fails; after acknowledgment loss remote outcome may be unknown. | — |
| PUB-26 | P1 | SSH fixture | Network lost, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Fail the fixture transport before send or after remote completion. 2. Compare receipt, publication, staging and current. | Before effects fails; after acknowledgment loss remote outcome may be unknown. | — |
| PUB-27 | P1 | SSH fixture | Disk full or file inaccessible, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Refuse receipt writes or fail staging filesystem at checkpoint. 2. Compare receipt, publication, staging and current. | Requested pre-step receipt failure prevents that step; earlier completed work remains. | — |
| PUB-28 | P1 | SSH fixture | Disk full or file inaccessible, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Refuse receipt writes or fail staging filesystem at checkpoint. 2. Compare receipt, publication, staging and current. | Requested pre-step receipt failure prevents that step; earlier completed work remains. | — |
| PUB-29 | P1 | SSH fixture | Required state changes, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Change candidate remote contents using the fixture controller. 2. Compare receipt, publication, staging and current. | Locked verification rejects conflicting content/bindings. | — |
| PUB-30 | P1 | SSH fixture | Required state changes, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Change candidate remote contents using the fixture controller. 2. Compare receipt, publication, staging and current. | Locked verification rejects conflicting content/bindings. | — |
| PUB-31 | P1 | SSH fixture | Concurrent invocation, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Start a second identical or conflicting PUB. 2. Compare receipt, publication, staging and current. | Final locked verification preserves immutability; identical attempts may succeed. | — |
| PUB-32 | P1 | SSH fixture | Concurrent invocation, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Start a second identical or conflicting PUB. 2. Compare receipt, publication, staging and current. | Final locked verification preserves immutability; identical attempts may succeed. | — |
| PUB-33 | P1 | SSH fixture | Forced kill, before work (interrupt). | PUB held before the first remote step; fresh receipt. | 1. Send SIGKILL at the checkpoint. 2. Compare receipt, publication, staging and current. | Cleanup can be skipped; inspect running/unknown receipt and remote state. | — |
| PUB-34 | P1 | SSH fixture | Forced kill, during work (interrupt). | PUB held after its started checkpoint; fresh receipt. | 1. Send SIGKILL at the checkpoint. 2. Compare receipt, publication, staging and current. | Cleanup can be skipped; inspect running/unknown receipt and remote state. | — |
| PUB-35 | P1 | Local | Planning reports the selected publication metadata (preview and inspection). | Valid fixture bundle and destination selectors. | 1. Run PLAN. 2. Parse identity, payloads, steps, destination, and publication digest. | The report describes the selected publication without claiming it was performed. | Fixture pass, O1 observation-01-plan.json. |
| PUB-36 | P1 | Local | Planning distinguishes explicit and environment-based selection (preview and inspection). | Manifest with two environment assignments. | 1. Plan with an environment only. 2. Plan with an explicit host or deployment file. | Selection mode identifies the choice; item selection follows the publication rules. | Fixture pass, O1 selected-plan.json and observation-01-plan.json. |
| PUB-37 | P1 | Local | A publication plan is metadata-only (preview and inspection). | Valid manifest with unavailable destination. | 1. Run PLAN. 2. Read the report boundary. | The output identifies a metadata preview and makes no publication-readiness guarantee. | Fixture observation, O1 observation-01-plan.json. |
| PUB-38 | P1 | Local | Planning does not require payload contents (preview and inspection). | Valid manifest; remove declared local payloads. | 1. Run PLAN. 2. Inspect its payload declarations. | Metadata preview still succeeds without opening missing payloads. | Fixture pass, O1 observation-11-plan.json. |
| PUB-39 | P1 | Local | Planning starts no SSH or rsync process (preview and inspection). | SSH and rsync paths both /bin/false; nonexistent identity path. | 1. Run PLAN with those paths. 2. Inspect exit status and report. | Preview succeeds without executing the failing transport commands or opening the identity. | Fixture pass, O1 observation-01-plan.json. |
| PUB-40 | P2 | Local | A port owned by SSH configuration stays unspecified (preview and inspection). | Destination without an explicit port. | 1. Run PLAN. 2. Inspect its destination port. | The report does not invent a resolved SSH port. | Fixture pass, O1 observation-01-plan.json. |
| PUB-41 | P1 | SSH fixture | Local payload validity and matching remote publication are independent (preview and inspection). | Matching published fixture; remove then corrupt the local payload in separate observations. | 1. Run INSPECT. 2. Compare local and remote observations. | Local missing data is reported alongside the matching remote publication. | Fixture pass, O1 observations 10 and 12. |
| PUB-42 | P1 | SSH fixture | Inspection distinguishes an absent publication (preview and inspection). | Valid bundle; absent fixture publication. | 1. Run INSPECT. 2. Read publication state. | Publication is reported absent without being created. | Fixture pass, O1 observation-02-inspect.json. |
| PUB-43 | P1 | SSH fixture | Inspection verifies a matching publication (preview and inspection). | Complete matching fixture publication. | 1. Run INSPECT. 2. Read publication state. | Publication matches the selected manifest and payload declarations. | Fixture pass, O1 observation-09-inspect.json. |
| PUB-44 | P1 | SSH fixture | Inspection reports a conflicting publication identity (preview and inspection). | Different canonical manifest at the selected publication path. | 1. Run INSPECT. 2. Compare the remote files before and afterward. | Conflict is reported; original publication remains unchanged. | Fixture pass, O1 observation-15-inspect.json. |
| PUB-45 | P1 | SSH fixture | Inspection reports damaged published bytes (preview and inspection). | Matching manifest with a corrupt or extra payload. | 1. Run INSPECT. 2. Read the publication finding. | Corruption is reported without repair. | Fixture pass, O1 observations 13 and 14. |
| PUB-46 | P1 | SSH fixture | Inspection reports retained-site and activation state separately (preview and inspection). | Published/extracted fixture site initially inactive. | 1. Inspect. 2. Activate through a separate authorized fixture operation. 3. Inspect again. | Retention and activation are separate observations. | Fixture pass, O1 observations 16 and 17. |
| PUB-47 | P1 | SSH fixture | Activation does not hide invalid retained-site state (preview and inspection). | Current link selects the fixture version; damage its retained-site binding. | 1. Run INSPECT. 2. Read both retained-site and activation observations. | The invalid site is reported independently from its active selection. | Fixture pass, O1 observations 23 and 24. |
| PUB-48 | P1 | SSH fixture | A failed remote read is unavailable rather than absent (preview and inspection). | Missing/inaccessible root, failed transport, malformed response, timeout, and excessive-output cases. | 1. Run INSPECT. 2. Capture JSON and exit status. | Nonzero status; unavailable or unknown remote observations do not claim absence. | Fixture pass, O1 observations 03 through 08. |
| PUB-49 | P2 | SSH fixture | Third-party inspection has no website lifecycle (preview and inspection). | Valid third_party artifact selection. | 1. Run INSPECT. 2. Read site observation. | Website state is not applicable. | — |
| PUB-50 | P1 | SSH fixture | Inspection does not create staging or mutation locks (preview and inspection). | O1 fixture captures destination entry names, bytes, modes, modification times, and symlink targets. | 1. Run every plan/inspection case. 2. Compare each before/after tree. | No publication, staging, lock, extraction, or link mutation is introduced. | Fixture pass, O1 TestReleaseObservationCLI destination-tree comparisons. |
| PUB-51 | P1 | Local and SSH fixture | Inspection rejects operation-receipt flags (inspection). | Valid fixture selection and a disposable receipt path. | 1. Run INSPECT with --receipt PATH. 2. Capture its status. | The unsupported flag causes a nonzero exit. | Fixture pass, O1 TestReleaseObservationCLI receipt-flag rejection. |
| PUB-52 | P1 | Local and SSH fixture | A later publication rereads inputs after planning (preview and inspection). | Successful plan followed by changed bundle metadata. | 1. Change the fixture input. 2. Run a separate publication attempt. 3. Inspect the selected identity or refusal. | The earlier report does not bind or authorize the changed publication. | — |
| PUB-53 | P2 | Pipe fixture | A lost observation report is not a publication (interrupts). | PLAN and INSPECT separately paused before final output. | 1. Close each stdout reader. 2. Inspect fixture destination and receipt paths. | A complete report is not assumed; no publication or recovery mutation is started. | — |
| PUB-54 | P1 | Interrupt fixture | Interrupting inspection does not publish or repair (interrupts). | INSPECT paused during a controlled remote read. | 1. Send SIGINT and SIGTERM in separate cases. 2. Inspect destination contents and receipt paths. | No mutation is started; obtain fresh observations in a later invocation. | — |
| PUB-55 | P2 | SSH fixture | Inspection does not reserve observed state (preview and inspection). | Valid inspection followed by a separate controlled destination change. | 1. Capture the first report. 2. Change the fixture destination. 3. Inspect again. | The later report reflects new observations; the earlier report grants no lock. | Fixture pass, O1 observations 02, 09, 16, and 17. |
| PUB-56 | P1 | SSH fixture | Unsafe current selection is unknown rather than inactive (inspection). | Current targets with trailing/embedded newline or an absolute path, and a current directory, in separate cases. | 1. Run INSPECT. 2. Read current-link and active fields. | Current is unsafe and active is null; site validity remains a separate finding. | Fixture pass, O1 observations 18 through 21. |
| PUB-57 | P1 | SSH fixture | A dangling link can still name the selected version (inspection). | Current link names this version, but its retained directory is absent. | 1. Run INSPECT. 2. Read site, current, and active fields. | Site is absent, current is dangling, and active is true as a selection observation. | Fixture pass, O1 observation-22-inspect.json. |
| PUB-58 | P1 | SSH fixture | Inspection supports reconciliation without rewriting the attempt receipt (finishes). | Unknown upload receipt and a matching published fixture identity. | 1. Run INSPECT with the same bundle/destination. 2. Compare publication digest and remote state with the receipt. 3. Read receipt bytes again. | Matching remote state is observable; the original receipt is unchanged and no retry starts automatically. | — |
| PUB-59 | P2 | Local | Planning reports configured execution accounts (inspection). | O1 plan with explicit synthetic SSH and content accounts. | 1. Run PLAN. 2. Read destination account selectors. | The report names the configured ssh_user and publish_user without resolving credentials. | Fixture pass, O1 observation-01-plan.json. |
| PUB-60 | P2 | Local | Planning rejects operation-receipt flags (inspection). | Valid selection and disposable receipt path. | 1. Run PLAN with --receipt PATH. 2. Inspect status. | The unsupported flag causes a nonzero exit. | — |
| PUB-61 | P2 | Local and SSH fixture | An unreadable local payload does not suppress destination inspection (inspection). | Unprivileged isolated fixture with a selected mode-000 local payload and readable matching destination. | 1. Run INSPECT. 2. Read local and remote fields. | Local status is unreadable and remote matching is reported independently. | — |
| PUB-62 | P1 | SSH fixture | Completed corruption/conflict observations can exit zero (inspection). | O1 corrupt and conflicting publication cases. | 1. Run the cases. 2. Compare finding and process exit. | Exit zero accompanies the finding; it does not certify publication readiness. | Fixture pass, O1 observations 13 through 15. |
| PUB-63 | P2 | Local and SSH fixture | Planning and inspection identify their JSON contracts (inspection). | O1 valid plan and absent-publication inspection. | 1. Parse both reports. 2. Read schema and mode. | Plan uses release/artifact_plan/v1 and offline_metadata; inspection uses release/artifact_inspection/v1 and read_only_snapshot. | Fixture observation, O1 observations 01 and 02. |
| PUB-64 | P1 | Linux interrupt fixture | Cancellation interrupts local hashing before SSH (inspection). | TestReleaseInspectionCancellationCLI observes hashing of a large sparse synthetic payload. | 1. Wait for the fixture hash-start observation. 2. Send SIGTERM. 3. Inspect exit and SSH marker. | The command promptly returns nonzero, starts no SSH, and does not report cancellation as corruption; no fixed elapsed-time guarantee is implied. | Fixture pass, O1 inspection-cancellation.json. |
| PUB-65 | P1 | Local | Website extraction has an offline preview (preview). | Valid archive declaration; failing transport executables and nonexistent identity path. | 1. Run EXTRACT with –dry-run.
2. Read JSON and compare the fixture tree. | Plan uses offline_metadata with only extract; no SSH call or destination mutation occurs. | Fixture pass, W1 observation-02-extract.json and unchanged-tree checks. |
| PUB-66 | P1 | Local | Website activation has an offline preview (preview). | Valid bundle metadata; failing transport executables and nonexistent identity path. | 1. Run ACTIVATE with –dry-run.
2. Read JSON and compare the fixture tree. | Plan uses offline_metadata with only link; retained-site readiness is not asserted and no SSH call starts. | Fixture pass, W1 observation-03-activate.json and unchanged-tree checks. |
| PUB-67 | P1 | Local | Website dry runs reject requested receipts (invoke). | Both website operations; absent receipt and transport marker. | 1. Add –dry-run and –receipt PATH to each website operation.
2. Inspect receipt paths and the fixture tree. | Nonzero before any receipt or remote effect. | Fixture pass, W1 TestReleaseObservationCLI receipt refusal and no-file checks. |
| PUB-68 | P2 | Local | Archive selection belongs only to extraction (invoke). | Valid bundle metadata and destination selectors. | 1. Preview EXTRACT with –site_archive NAME.
2. Supply –site_archive to ACTIVATE and PUB separately. | Extraction accepts its archive selector; the other commands reject the unknown flag. | Fixture pass, W1 extraction preview and al-retired-invocations.json. |
| PUB-69 | P1 | Local | Artifact planning selects upload only (preview). | Valid fixture bundle with a site archive. | 1. Run PLAN.
2. Read steps. | The fixed operation is upload; no extraction or activation is planned. | Fixture pass, W1 observation-01-plan.json. |
Not checkable by hand: guarantees across all crash timings or noncooperating writers. Use source inspection and controlled fault fixtures; never interpret one successful run as universal atomicity.
Versioning
VER-04, VER-13, and VER-26 are retired with create-time checkout; VER-24 is
retired with the stamped-build wrapper. Those IDs remain reserved. Ordinary
Bazel stamping is covered by VER-45–47; release creation and explicit checkout
are covered by VER-48–49.
VER below means AL version --repository REPOSITORY, with an absolute path to
a fresh synthetic Git checkout under task scratch. Initialize it with clean
trunk, one ordinary payload commit, and a local bare origin whose trunk points
to that commit. The fixed example date is 2026-11-02; it makes the sample
identity reproducible. PLAN and RECEIPT are absolute task-scratch paths.
CREATE means AL release create --repository REPOSITORY. A prepared weekly
fixture has run CREATE and then git -C REPOSITORY checkout releases/2026.45;
creation alone leaves the selected branch unchanged.
Never point these preparation or publication commands at the real repository.
The scripted results name observations from the local-bare-remote pass recorded
on 2026-11-02 in observations-release/observations.json. They do not claim live
SSH authentication or interactive-terminal coverage. Interrupt rows need
controlled pause/failure hooks in a disposable process or remote; mark them
blocked if the setup is unavailable.
| ID | P | Device | Claim | Setup | Steps | Expected | Result |
|---|
| VER-01 | P1 | Local | A clean untagged checkout reports development (invoke). | Fresh REPOSITORY fixture. | 1. Run VER show --format json. 2. Read version, branch and tree state. | Development version, trunk branch, exact commit, and clean state. | pass (scripted: version-development) |
| VER-02 | P2 | Local | Dry run reports the intended weekly branch (short path). | Fresh REPOSITORY fixture. | 1. Run CREATE --date 2026-11-02 --dry-run. | Exit zero and the intended weekly branch name on stdout. | pass (C1: dry-run branch output and unchanged refs; fixture date 2026-08-30) |
| VER-03 | P1 | Local | Dry run does not switch the checkout (short path). | Fixture immediately after VER-02. | 1. Run VER show --format json. 2. Compare branch and source version with VER-01. | Checkout remains on trunk with the development version. | —; prior version-after-dry-run is historical |
| VER-05 | P1 | Local | The plan names exact source refs and commit (begin). | Prepared weekly fixture. | 1. Run VER release-plan --lease fixture --plan PLAN. 2. Read emitted JSON. | Plan names the weekly branch, initial tag, exact source commit, expected trunk and atomic selection. | pass (scripted: version-plan) |
| VER-06 | P1 | Local bare remote | Publication reports verified remote source refs (finish). | VER-05 plan and matching bare origin. | 1. Run VER release-publish --plan PLAN --receipt RECEIPT. 2. Read receipt JSON. | Receipt is verified and binds the planned branch/tag to the exact commit. | pass (scripted: version-publish-local) |
| VER-07 | P1 | Local bare remote | Existing identical source refs can be verified on retry (running). | Already published VER-06 refs. | 1. Repeat VER release-publish --plan PLAN. 2. Compare receipt ref bindings. | Success with the same ref-to-commit bindings. | pass (scripted: version-publish-retry) |
| VER-08 | P1 | Local | Release status emits concrete source identity (running). | Clean prepared weekly fixture. | 1. Run VER bazel-status. | Stable version, channel, commit and clean-tree keys are printed. | pass (scripted: version-status) |
| VER-09 | P2 | Local | Text is the default inspection format (modifiers). | Fresh fixture with known version. | 1. Run VER show. 2. Compare with JSON version field. | Stdout contains the version text and newline. | — |
| VER-10 | P2 | Local | Repository selection works before or after the leaf command (modifiers). | Fresh fixture outside the current working directory. | 1. Run AL version --repository REPOSITORY show --format json. 2. Run AL version show --repository REPOSITORY --format json. 3. Compare JSON. 4. Try the removed --repo flag. | Both canonical placements report the selected fixture; --repo fails as an unknown flag. | Fixture pass, TestLifecycleCLI; api-naming/compatibility-evidence/al-retired-invocations.json retains both canonical observations and explicit obsolete-input refusals. |
| VER-11 | P1 | Local | Inspection selectors cannot mutate refs (invoke). | Fresh clean trunk fixture. | 1. Run VER --channel nightly nightly-tag --date 2026-11-02. 2. Inspect failure and local refs. | The selector is refused for ref mutation; no requested refs are created. | — |
| VER-12 | P2 | Local | A date flag fixes the intended calendar operation (modifiers). | Fresh fixture. | 1. Run two dry runs with dates in distinct ISO weeks. 2. Compare printed branch names. | Names follow each explicitly selected week. | — |
| VER-14 | P1 | Local | Dirty nondevelopment stamping is refused (short path). | Prepared weekly fixture with an unstaged payload edit. | 1. Run VER bazel-status. | Nonzero status; no successful release status output. | — |
| VER-15 | P1 | Local | Dry run checks ref collisions (short path). | Fresh fixture with an existing target weekly branch. | 1. Run CREATE --date 2026-11-02 --dry-run. | The existing ref causes a refusal. | — |
| VER-16 | P1 | Local | A second nightly on unchanged source is refused (begin). | Fresh fixture on trunk. | 1. Create a nightly for 2026-11-02. 2. Attempt another for 2026-11-03 without a commit. | The second invocation refuses another nightly at the same source commit. | — |
| VER-17 | P1 | Local bare remote | Conflicting remote tags are not overwritten (running). | Weekly plan; bare origin’s planned tag points to a different fixture commit. | 1. Invoke VER release-publish --plan PLAN. 2. Inspect remote tag. | Publication fails and the conflicting tag is preserved. | — |
| VER-18 | P1 | Local bare remote | Atomic selection must match the plan (begin). | Atomic weekly plan. | 1. Invoke VER release-publish --plan PLAN --atomic=false. | Mismatch is refused before publication. | — |
| VER-19 | P1 | Local bare remote | Atomic publication requires an explicit plan lease (begin). | Plan generated without --lease; matching remote. | 1. Invoke VER release-publish --plan PLAN. | Publication refuses the missing lease rather than assuming authority. | — |
| VER-20 | P1 | Local bare remote | Patches can publish independently of diverged trunk (running). | Disposable weekly branch with one patch commit, matching remote weekly branch, and separately advanced remote trunk. | 1. Tag the patch. 2. Generate its plan. 3. Publish to the bare origin. | Patch tag verifies without requiring trunk to equal the patch. | — |
| VER-21 | P1 | Local | Ambiguous detached source needs explicit context (edge cases). | Detached fixture commit with matching nightly and release tags. | 1. Run VER show. 2. Retry with an explicit valid channel. | Ambiguous automatic selection fails; explicit matching context resolves it. | — |
| VER-22 | P2 | Local | Workspace environment can choose the default repository (modifiers). | Synthetic BUILD_WORKSPACE_DIRECTORY=REPOSITORY; shell starts elsewhere. | 1. Run AL version show --format json without a repository flag. | Output identifies REPOSITORY rather than the shell’s directory. | — |
| VER-23 | P1 | TTY Git fixture | Foreground Git can authenticate through the terminal (modifiers). | Existing controlling-terminal fixture using synthetic prompts from cmd/al/lifecycle_e2e_test.go. | 1. Start its version operation. 2. Supply requested test input. 3. Observe foreground ownership after child exit. | Input reaches Git and AL restores terminal ownership. | — |
| VER-25 | P1 | Filesystem fault fixture | Remote publication can precede local receipt failure (finish). | Matching bare remote and plan; receipt path fails writing after publication. | 1. Publish with that receipt path. 2. Inspect diagnostic and remote refs. | Command fails to write evidence although remote refs can already match the plan. | — |
| VER-27 | P1 | Interrupt fixture | Ctrl+C once or twice, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Send SIGINT once; repeat from a fresh fixture with two SIGINT signals. 2. Compare local refs, bare-remote refs, receipt and lock state. | Cancellation is requested; inspect any refs and outputs already created. | — |
| VER-28 | P1 | Interrupt fixture | Ctrl+C once or twice, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Send SIGINT once; repeat from a fresh fixture with two SIGINT signals. 2. Compare local refs, bare-remote refs, receipt and lock state. | Cancellation is requested; inspect any refs and outputs already created. | — |
| VER-29 | P1 | Interrupt fixture | SIGTERM, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Send SIGTERM to the recorded AL PID. 2. Compare local refs, bare-remote refs, receipt and lock state. | Cancellation is requested without whole-workflow rollback. | — |
| VER-30 | P1 | Interrupt fixture | SIGTERM, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Send SIGTERM to the recorded AL PID. 2. Compare local refs, bare-remote refs, receipt and lock state. | Cancellation is requested without whole-workflow rollback. | — |
| VER-31 | P1 | Interrupt fixture | Terminal closed (SIGHUP), before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Close the disposable controlling terminal or send SIGHUP. 2. Compare local refs, bare-remote refs, receipt and lock state. | No dedicated AL recovery; inspect state and any source-ref lock. | — |
| VER-32 | P1 | Interrupt fixture | Terminal closed (SIGHUP), during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Close the disposable controlling terminal or send SIGHUP. 2. Compare local refs, bare-remote refs, receipt and lock state. | No dedicated AL recovery; inspect state and any source-ref lock. | — |
| VER-33 | P1 | Interrupt fixture | Input or output pipe closes, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Close the selected input/output pipe at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Record authentication/report failure and persistent state; published refs can remain. | — |
| VER-34 | P1 | Interrupt fixture | Input or output pipe closes, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Close the selected input/output pipe at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Record authentication/report failure and persistent state; published refs can remain. | — |
| VER-35 | P1 | Interrupt fixture | Network lost, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Make the isolated transport fail at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Local inspection needs no remote; publication can fail without proving remote refs are absent. | — |
| VER-36 | P1 | Interrupt fixture | Network lost, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Make the isolated transport fail at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Local inspection needs no remote; publication can fail without proving remote refs are absent. | — |
| VER-37 | P1 | Interrupt fixture | Disk full or file inaccessible, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Activate a controlled read/write failure at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Record the error and existing refs/evidence; earlier changes can remain. | — |
| VER-38 | P1 | Interrupt fixture | Disk full or file inaccessible, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Activate a controlled read/write failure at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Record the error and existing refs/evidence; earlier changes can remain. | — |
| VER-39 | P1 | Interrupt fixture | Required state changes, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Change the relevant fixture source or remote ref at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Conflicting expectations are refused where rechecked; record the boundary. | — |
| VER-40 | P1 | Interrupt fixture | Required state changes, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Change the relevant fixture source or remote ref at the pause. 2. Compare local refs, bare-remote refs, receipt and lock state. | Conflicting expectations are refused where rechecked; record the boundary. | — |
| VER-41 | P1 | Interrupt fixture | Concurrent invocation, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Start another fixture operation on the same refs and common Git directory. 2. Compare local refs, bare-remote refs, receipt and lock state. | Local creates remain guarded and publication contends for its shared operation lock. | — |
| VER-42 | P1 | Interrupt fixture | Concurrent invocation, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Start another fixture operation on the same refs and common Git directory. 2. Compare local refs, bare-remote refs, receipt and lock state. | Local creates remain guarded and publication contends for its shared operation lock. | — |
| VER-43 | P1 | Interrupt fixture | Forced kill, before work (interrupt). | Invocation held before its selected local/ref-publication operation. | 1. Send SIGKILL to the recorded disposable AL PID. 2. Compare local refs, bare-remote refs, receipt and lock state. | Cleanup may not run; inspect retained refs, lock and evidence before retrying. | — |
| VER-44 | P1 | Interrupt fixture | Forced kill, during work (interrupt). | Invocation held after a controlled durable-step or remote-transfer checkpoint. | 1. Send SIGKILL to the recorded disposable AL PID. 2. Compare local refs, bare-remote refs, receipt and lock state. | Cleanup may not run; inspect retained refs, lock and evidence before retrying. | — |
| VER-45 | P1 | Installed AL, Bazel, Git fixture | Ordinary Bazel supplies stamped source identity (running). | Clean tagged fixture with a release bundle and the root workspace-status adapter; AL on PATH. | 1. Run bazel build --config=release //:bundle in the fixture. 2. Read release.json and compare with the Git commit/tag. | Bundle version, channel, commit, and clean-tree fields match the selected source. | Fixture pass, B1 plain-release-consumer/result.json. |
| VER-46 | P1 | Installed AL, Bazel, Git fixture | A release build refuses dirty source (short path). | VER-45 fixture with an unstaged tracked payload edit. | 1. Repeat the ordinary release build. 2. Inspect status and diagnostics. | Workspace-status failure reports dirty nondevelopment source; no successful release build is claimed. | Fixture pass, B1 dirty-build.log; clean recovery verified. |
| VER-47 | P1 | Bazel, Git fixture | Release stamping requires installed AL (running). | Clean release fixture with the status adapter; invoke Bazel by its absolute path and remove AL from the fixture PATH. | 1. Build the release bundle. 2. Capture status and diagnostic. | The build fails with AL installation guidance; no nested Bazel bootstrap starts. | Fixture pass, B1 missing-al-build.log; installation guidance. |
| VER-48 | P1 | Local Git fixture | Weekly creation creates both refs without changing the checkout (begin). | Fresh clean trunk fixture; record HEAD and the selected branch. | 1. Run CREATE --date 2026-11-02. 2. Read the created branch and tag OIDs. 3. Compare HEAD and the selected branch with the recorded values. | releases/2026.45 and v2026.45.0 name the original trunk commit; HEAD and the selected branch are unchanged. | pass (C1: release-creation.json; both refs match trunk, HEAD unchanged) |
| VER-49 | P1 | Local Git fixture | Ordinary Git checkout selects the created release for inspection and builds (simple case). | Successful VER-48 fixture. | 1. Run git -C REPOSITORY checkout releases/2026.45. 2. Run VER show --format json. | The selected branch is releases/2026.45, channel is release, and version is 2026.45.0. | pass (C1: explicit Git checkout and stamped 2026.35.0; release-create-consumer/result.json) |
Not checkable by hand: all possible crash timings, remote implementations, or
arbitrary external writers. The non-atomic option is a product choice with a
partial-progress boundary; one successful invocation cannot establish stronger
atomicity. No interruption result above should be marked passed from source
reading alone.
2.3.3 - Bazel setup, affected tests, and diagnostics
Direct Bazel commands, Git-aware test selection, and local configuration reports
Run Bazel directly from the owning workspace:
bazel test //path/to/package:all
bazel build --config=release //projects/autoscroll/releases:bundle
The repository’s Bazelisk configuration pins Bazel. Per-user output and resource
defaults belong in ~/.bazelrc; the repository setup guide
describes the agent setup and its managed host configuration. No AL command or
named agent profile is required to build or test. Bazel owns argument parsing,
progress, signals, and exit status.
The root release configuration enables stamping through the installed AL command.
See Build one project for prerequisites and
source-version selection. It does not start another Bazel client during a build.
Bazel actions use declared outputs and Bazel-managed temporary storage, and
tests use their test temporary-directory contract. Repository-updating host
tools that need scratch accept or derive an explicit task/run path under
out/<task>/; do not propagate ambient TMPDIR, TMP, or TEMP to the whole
build.
Test affected targets
Use al bazel test to select tests affected by changes since an explicit Git
base, then run those tests with ordinary Bazel:
al bazel test --base master --dry-run
al bazel test --base master
al bazel test --base master //projects/example/...
Target patterns must be absolute; the scope defaults to //....
--workspace PATH selects another Bazel workspace, resolving a relative path
from the current directory. Otherwise discovery starts from
BUILD_WORKSPACE_DIRECTORY when present or the current directory and finds the
nearest workspace root. The base is resolved in the enclosing Git repository
and must have one merge base with HEAD. Selection includes changes from that
merge base through the working tree, staged edits, and nonignored untracked paths.
Bazel queries map changed source files to their reverse dependencies and tests
within the requested scope. Deleted, unknown, configuration, or outside-workspace
paths select the full test scope when a narrower set cannot be established. A query failure
fails the command; partial query results are not accepted as a complete test
selection. The scope belongs to one workspace; check other affected nested
workspaces separately.
When selection narrows the requested tests, work needed only by unrelated tests
stays outside the test invocation. Missing or evicted cache entries for that
unrelated work therefore do not trigger rebuilds or reruns. The dependency query
still loads the requested graph, and selected tests use Bazel’s normal cache
behavior. No speedup is guaranteed for a particular change.
The command prints one JSON selection on stdout before any tests run. Query
diagnostics and all test output go to stderr. Its bazel/test_selection/v1
report contains the resolved workspace/base/merge base, requested scope,
Git-root-relative changed_paths, selection, reasons, tests, and dry_run.
selection is affected, full_scope,
or no_changes; fallback reasons identify the paths that prevented narrowing.
No changed paths means no Bazel query or test invocation. An empty test selection
also succeeds without invoking tests. Wildcard scopes exclude root targets with
the literal manual tag before expanding test suites. An explicitly named test
or suite remains eligible, as do the members listed by an eligible suite,
including manual-tagged members. Ordinary Bazel test filters can further filter
the selected labels.
--dry-run skips test execution but can still run dependency queries. Normal
test failures return a nonzero status; the preceding JSON is a selection report,
not a passing-test receipt. This command selects tests; it does not implement a generic
Bazel passthrough, prepare a delivery candidate, or record a validation ledger.
Use ordinary Bazel commands for builds, other subcommands, and custom invocations.
Diagnostics
al doctor --workspace-root PATH --task-scratch out/<task>/<run> is a read-only
JSON diagnostic. It reports AL and built-source identity, declared Bazelisk
pins, platform, a configured rc-file inventory, and
task scratch classification without dumping the environment or launching Bazel.
The workspace root defaults to the current directory. Select a different layout
with --bazelisk-config PATH, --source-binary PATH, and repeated --rc-file PATH.
Relative inputs resolve against the selected workspace root. For example:
al doctor --workspace-root /absolute/workspace \
--bazelisk-config config/bazelisk.conf \
--source-binary build/al \
--rc-file .bazelrc --rc-file "$HOME/.bazelrc" \
--task-scratch out/task/run
The pin-file default is .bazeliskrc. Without a source-binary override, doctor
looks for the executable built by @rules_al//:al in the selected workspace’s
default bazel-bin directory. An available comparison reports its resolved
absolute path and digest. A missing comparison file reports
source.reason: unavailable.
The rc inventory defaults to .bazelrc. Explicit --rc-file entries replace
that default and are reported relative to the workspace when possible. Doctor
does not read those files, verify their existence, or discover Bazel’s imports;
the list describes the supplied configuration and does not establish effective
Bazel options. Reading the required pins or available source
binary can fail the command; an unavailable comparison or conflicting scratch
classification remains a report finding.
Installation
From this repository’s root, install or update AL with:
bazel run //tools/al:install
The shared binary installer atomically copies the executable to
~/.local/bin/al with mode 0755. It accepts
-- --directory /absolute/path for an isolated destination. After every
code update to this project, rerun the install target; the installed binary is
not updated automatically.
2.3.4 - Repository delivery
Guarded Git and pull-request delivery
al delivery implements the deterministic part of repository delivery. It
invokes native Git and a selected forge CLI; it does not infer task ownership,
choose validation commands, resolve conflicts, or judge review feedback.
Status and immutable changed-path inventories, and preparation receipts,
support complete output up to 4 MiB so large source relocations can use the
guarded workflow. Stable reads and writes enforce that
limit; other typed local records retain their 256 KiB limit. Receipt schema,
scope, integrity, and publication checks apply at either size.
Build and install
@rules_al//:al builds the current local source. Install the standalone
command explicitly:
bazel run //tools/al:install
al delivery provider
Installation atomically replaces ~/.local/bin/al with mode 0755.
Ensure that directory is on PATH. It copies the executable rather than
linking to Bazel outputs, so it remains available after those outputs are
removed. Rerun the target to update an installed command after source changes.
No AL executable cache or binary download is involved.
For an isolated installation, pass an absolute destination directory:
bazel run //tools/al:install -- --directory "$PWD/out/install/bin"
Provider and delivery workflow
Run delivery commands from this Git worktree’s repository root, which owns the
root MODULE.bazel and imports rules_al. This also applies when changed
files belong to a nested Bazel module: its workspace does not own the delivery
target. Use the same feature worktree, not another checkout. The Bazel entry
point builds AL from the current source. Detect the provider without printing a
credential-bearing remote URL:
bazel run @rules_al//:al -- delivery provider
The installed al delivery command is an optional direct entry point. An
execution failure or delivery refusal requires diagnosis. All examples below
use the Bazel entry point.
The repository’s delivery skill
owns remote selection. Pass --remote <name> consistently when selecting a
remote other than the default origin. The PR belongs on the selected remote’s
forge; a GitHub or Forgejo mirror does not become the destination merely because
its tooling is available. The Forgejo procedure
uses fj when the selected remote is Forgejo, even while the AL adapter is unavailable.
The sanitized report distinguishes forge support from Git transport support.
adapter_available reports whether the forge has an adapter;
git_transport reports ssh, https, or mixed_or_unsupported by default,
and gh when that mode is explicitly selected.
delivery_transport_available is true when both captured endpoints are valid
for the selected mode: canonical SSH endpoints by default, or canonical GitHub
SSH/HTTPS endpoints in gh mode. It never reports either endpoint.
For the supported GitHub adapter, preparation, checks, and publication are
separate commands:
bazel run @rules_al//:al -- delivery inspect --base master
bazel run @rules_al//:al -- delivery prepare \
--base master \
--message-file out/task/commit.md \
--receipt-file out/task/prepare.json \
--path path/to/task/file
bazel test //:repo_quality_test @rules_al//internal/delivery:go_test
bazel run @rules_al//:al -- delivery publish \
--receipt-file out/task/prepare.json
bazel run @rules_al//:al -- delivery verify \
--receipt-file out/task/prepare.json
Use --rewrite <inspect.local_head_oid> when replacing an existing owned
single-commit candidate, or --consolidate <inspect.local_head_oid> for an
explicitly reviewed task-owned multi-commit range. The inspected value must be
carried literally.
To add a co-author to agent commits, set the account’s global Git configuration
key al.deliveryCoAuthor to one Name <email> identity. prepare adds the
configured identity once in the final trailer block, immediately before the LLM
disclaimer. Use the account’s global Git file directly. The lookup excludes
included and repository-local files.
prepare performs Git preparation and writes the typed receipt. It does not
invoke Bazel, select affected targets, or produce a validation plan. Run the
normal build, test, and lint commands appropriate to the changed components
after preparation. The test command above is an example for delivery changes,
not a complete check selection for every task. Use each target’s owning
workspace, ordinary Bazel options, and Bazel’s normal cache behavior.
Inspect the check results before publishing. Failed checks leave the prepared
candidate available for diagnosis; AL does not record a check ledger or enforce
their outcome. After fixing source, prepare the changed candidate again. If
the candidate is unchanged, rerun the relevant ordinary Bazel checks without
creating another commit merely to retry them.
publish --receipt-file PATH verifies that current HEAD and tree match the
prepared candidate, requires a clean index and unchanged prepared scope, and
checks the remote lease and PR expectations before publication. The receipt binds Git state; it
does not assert that checks passed.
If push and PR synchronization complete but final verification fails,
publication_verification_pending retains the known candidate and PR identity
with verified: false. Preserve that report, link the known PR, and use
verify --receipt-file PATH while the original candidate remains checked out
to inspect the postcondition before deciding whether any mutation needs recovery. Do not infer that a failed final read
undid a successful push.
A PR update failure after the push also retains publication_verification_pending
with its candidate, observed remote head, and existing PR identity. GitHub’s PR
object can still report the exact previous head even though Git and the branch
API already identify the prepared candidate. Generic inspection remains strict.
For that exact receipt-bound state, explicitly synchronize only the historical
PR projection:
al delivery recover-pull-request --receipt-file out/task/prepare.json
Retain --git-transport gh when that transport is bound by the receipt. Recovery
requires the original receipt, same repository/endpoints/refs, exact already-pushed
commit/tree/scope, and unchanged PR identity, author/draft state, and prior or
desired projection. It rejects third heads, changed remote refs, human edits,
replacement PRs, and missing PRs. It preserves later local commits, index and
working files, and the receipt. It never pushes, rebases, or creates another PR.
An already synchronized PR needs no further mutation.
The recovery report’s head_oid is the historical prepared commit; local_head_oid
can be later local progress, and pushed is always false. Status
pull_request_synchronized verifies only the PR projection, without claiming
checks or remote review of current source. If mutation verification fails,
pull_request_verification_pending retains the known identities. Inspect the
actual remote/PR state before choosing another recovery attempt. After recovery,
resume normal inspection, preparation and validation for the current candidate;
ordinary publish and verify still require the exact clean prepared source.
To synchronize a prepared, task-owned, single-commit feature branch with an
advanced base before prepare, use the guarded adapter workflow:
bazel run @rules_al//:al -- delivery rebase --base master
The command refuses dirty trees, divergent remote feature tips, multi-commit
or merge-containing ranges, and incompatible pull-request metadata. It fetches
fresh refs, replays the commit in an isolated worktree, preserves signature
requirements, and reports the literal local head and captured remote lease.
It does not push or update the PR. Prepare the resulting candidate, run its checks,
then publish through the receipt-bound workflow. When the remote feature exists,
authorize its exact captured replacement only after confirming that all prior
task-owned progress is preserved. The later publisher refreshes both refs and
uses its exact lease; a rebase report is not validation evidence.
Remote rewrites use rewrite-authorize to write a typed, non-authorizing
authorization receipt (old remote OID, new head OID, owner root, task paths,
provider ownership), then prepare --rewrite-authorization <file> instead of
raw --replace-remote handoff. Review replies accept --goal-ref,
--delivery-ref, and --defect-id durable join references.
prepare refuses a divergent remote feature tip by default. Use
--replace-remote <literal-inspect.remote_head_oid> only after the
al-rebase workflow has preserved that exact old tip and established
that it is task-owned history the user authorized rewriting. Never infer the
OID or use this escape hatch for shared, stacked, human-owned, unrelated, or
ambiguous history. A mismatched, malformed, absent, or unnecessary
authorization is refused. The final fresh snapshot and preparation receipt
bind the same old remote OID for the later exact force-with-lease push.
prepare --consolidate <literal-inspect.local_head_oid> is the explicit
ownership authorization for replacing a multi-commit feature range with one
aggregate commit. It is not inferred from author names. The adapter still
requires a merge-free linear chain, one author and committer identity across
the range, the ownership disclaimer on its oldest commit, pull-request
metadata matching the requested aggregate message, and the exact inspected
head.
It preserves any signature requirement found in the range and keeps the
fetched remote feature tip as the publication lease. --consolidate and
--rewrite are mutually exclusive.
When a clean replay onto an advanced base makes an expected aggregate path
disappear from the resulting diff, the adapter accepts that shrink only when
the prior candidate and the new base have byte-identical Git tree entries at
that path. A new path, a non-identical disappearance, or an entirely empty
aggregate remains a refusal. The derived receipt records the reduced exact
aggregate path set.
For a message-only amendment, use
prepare --message-only --rewrite <exact-oid> with the new message and a
preparation receipt. Run the checks appropriate to that changed commit before
publishing through the same receipt-bound workflow.
SSH is the default Git transport, accepting canonical SCP-style or ssh://
fetch and push endpoints. Select --git-transport gh explicitly to use GitHub
CLI credentials over HTTPS. This mode accepts canonical GitHub SSH or HTTPS
remotes, derives the HTTPS endpoint for the captured repository, and uses the
selected --forge-cli executable (default gh) as a host-scoped credential
helper. It never reads tokens into AL, imports global Git configuration,
runs gh auth setup-git, rewrites remotes, or falls back automatically.
Authenticate using gh auth login when needed, then pass the same transport
selector throughout inspection, preparation, publication and verification:
al delivery provider --git-transport gh
al delivery inspect --git-transport gh --base master
al delivery publish --git-transport gh --base master \
--receipt-file out/task/prepare.json
Preparation receipts also bind transport mode; legacy receipts imply SSH.
Changing modes requires preparing a new receipt. HTTPS transport verifies TLS,
disables redirects and proxies, resets ambient credential helpers, disables
prompts and credential diagnostics, and rejects credentials in endpoint URLs.
gh authentication uses its configured credential store or supported token
environment variables; secrets do not belong in command arguments or output.
GitHub API preflight uses the selected forge CLI in both Git modes. An HTTP
401 there is independent of --git-transport. A sandbox can prevent the CLI
from retrieving a valid stored credential: the same login can succeed outside
it. AL’s HTTP 401 diagnostic points to an approved-context comparison; it does
not retry, extract tokens, change login state, or escalate itself. Follow the
delivery skill’s authentication recovery
procedure before requesting a new login or changing transport.
prepare writes a strict versioned receipt under an ignored
out/<task>/ directory. The receipt binds the prepared head and tree to the
exact worktree and Git directories, fetch and push endpoint digests, sanitized
repository identity, forge adapter, base and head refs, fetched base, expected
remote feature ref, expected pull-request identity or absence, and immutable
aggregate path scope. The file contains no
remote URL, must remain untracked, and is installed with mode 0600 by atomic
rename. It is a consistency record, not an unforgeable authorization token.
The adjacent receipt lock serializes receipt transitions and reads performed
by cooperating al delivery processes. Keep the ignored receipt path
trusted and do not edit, replace, copy over, or otherwise write it while
prepare, publish, or receipt-bound verify is running. Stable byte and
revision checks detect changes visible before their checks, but operating
systems do not provide a portable atomic
pathname-content compare-and-swap. A same-user process that ignores the lock
can race the final comparison and rename; the tool does not claim to exclude
that writer. A persistent exclusive revision-claim sidecar would have the same
trust boundary, while a crash before installation could strand the receipt
without a safe automatic cleanup decision, so it is not used.
Use repeated --path flags for fully task-owned paths, or pre-stage only
task-owned hunks and use --use-index. Both modes bind the complete existing
feature diff, not merely the paths newly staged by that invocation.
--message-only --rewrite <exact-oid> preserves the tree but changes the
commit OID. Consolidation also changes the commit OID and parent structure.
Every prepare, consolidation, or message-only amendment therefore requires a
validation decision bound to its returned exact head. Run required checks
after preparation by default. For a tree-preserving amendment, prior passing
evidence may be reused only after recording its exact prior candidate, the
matching tree OID, the new OID, and unchanged inputs relevant to each check.
Those inputs include commands, tools, configuration, and environment. Rerun
checks affected by commit identity, history, or stamping, and any check whose
input stability is unknown. The caller owns and records this applicability
judgment; the receipt neither proves validation nor authorizes reuse.
When an authorized remote replacement is pending, rewrite evidence accepts an
existing pull request only if its metadata matches the exact projectable local
or fetched-remote commit projection. A legacy remote tail that lacks an
aggregate disclaimer cannot block a matching local aggregate, and unrelated
pull-request text remains a refusal.
Publish and receipt-bound verify require current HEAD and tree to match the
receipt, a clean index, and no unstaged or untracked changes in the prepared
task scope. Unrelated unstaged and untracked files are preserved when no rebase
is needed. A required rebase demands a fully clean worktree and index.
Preparation receipts do not make later source edits part of the candidate.
If the base advances after preparation, publish rebases the exact captured
commit in an isolated ignored worktree and updates the preparation receipt.
It exits nonzero before pushing with status checks_required, identifying
the new head, tree, and derived receipt. Run the normal Bazel checks against
that candidate, then retry publish --receipt-file PATH with the same receipt.
Do not run prepare again unless content or the commit message must change.
A receipt also supports a guarded retry when the remote already equals its
prepared head but PR creation or metadata synchronization stopped partway
through. Inspect the current remote state first. Replacement PR identities and
any state other than the exact prior or desired projection are refused.
Multi-commit consolidation likewise requires an existing PR to equal the
requested aggregate message’s projection, so consolidation cannot silently
replace independently edited PR text.
The tool creates commits with Git plumbing and pushes one exact ref with hooks
disabled. It rejects shallow, promisor, or grafted history and ignores
replacement objects. Each network operation runs in a fresh private,
config-free bare Git directory bound to the captured endpoint, selected
transport, and repository’s canonical object database. It does not load mutable main-repo
local/worktree URL rewriting, proxy, TLS, SSH-command, or remote
configuration. Normal DNS resolution and SSH host-key verification still
apply; the tool does not claim to pin an IP address or server key. Ordinary
local Git operations still intentionally use repository identity and signing
configuration. Fetches use isolated temporary refs without pruning, then
install exact private refs locally; pushes use an exact force-with-lease.
Repository-required hook checks remain the caller’s responsibility and must
complete before publication.
The feature-ref lease and base-ref checks are separate because Git forges do
not offer a cross-ref compare-and-swap. If the base advances in the narrow push
window, the feature ref may be visible briefly before the tool detects the
race and attempts an exact guarded rollback. Coordinate consumers that react
immediately to branch-update webhooks.
Review workflow
Start with a bounded structured inventory:
bazel run @rules_al//:al -- delivery review inspect
For authorized feedback on a clean exact prepared candidate whose publication
is verified, use one command:
bazel run @rules_al//:al -- delivery review address \
--receipt-file out/task/prepare.json \
--thread-id <thread-id> --body-file out/task/reply.md
address checks the exact prepared candidate and verified remote publication,
derives current provider guards, posts the reasoned reply, saves its receipt,
and resolves the thread. It does not run checks or read validation logs.
The default reply receipt path is derived from the preparation receipt
and thread; --reply-receipt-file selects an explicit path in the same task
directory. A durable attempt checkpoint beside that file prevents duplicate
replies after interruption, success, or an unknown reply outcome. Retry with
the same paths after an explicitly reported read-failure restoration to resume
resolution using the unchanged receipt and expiry. Expired, consumed, or
changed authority stops without reposting. Inspect the actual remote state
before explicitly selecting a fresh receipt path for recovery. Keep checkpoints
trusted and do not delete them to bypass this protection.
Thread inventory includes each thread’s first comment page in its enclosing
request. Only additional comment pages need separate queries. All pages retain
shared byte, node, request, cursor, and metadata consistency checks.
The low-level commands remain available. Carry values from the latest inspection literally. All mutations require the
pull-request node ID, expected head, and pull-request expectation digest. A
top-level reply also requires the
reported last-comment sentinel and top-level inventory digest:
bazel run @rules_al//:al -- delivery review comment \
--pull-request-id <pull_request.id> \
--expected-head <pull_request.head_ref_oid> \
--expected-pull-request-digest <pull_request_expectation_digest> \
--expected-last-top-level-comment \
<expected_last_top_level_comment> \
--expected-top-level-comments-digest \
<expected_top_level_comments_digest> \
--body-file out/task/comment.md
Thread replies and resolutions additionally bind the thread, its last comment,
and its complete expectation digest:
bazel run @rules_al//:al -- delivery review reply \
--pull-request-id <pull_request.id> \
--expected-head <pull_request.head_ref_oid> \
--expected-pull-request-digest <pull_request_expectation_digest> \
--thread-id <review_threads[index].id> \
--expected-last-comment-id <review_threads[index].comments[-1].id> \
--expected-thread-digest <review_threads[index].expectation_digest> \
--body-file out/task/reply.md \
--reply-receipt-file out/task/reply.json
bazel run @rules_al//:al -- delivery review resolve \
--pull-request-id <pull_request.id> \
--expected-head <pull_request.head_ref_oid> \
--expected-pull-request-digest <pull_request_expectation_digest> \
--thread-id <review_threads[index].id> \
--expected-last-comment-id <review_threads[index].comments[-1].id> \
--expected-thread-digest <review_threads[index].expectation_digest> \
--reply-receipt-file out/task/reply.json
bazel run @rules_al//:al -- delivery review request \
--pull-request-id <pull_request.id> \
--expected-head <pull_request.head_ref_oid> \
--expected-pull-request-digest <pull_request_expectation_digest> \
--reviewer <login>
Comment and reply bodies must be ignored files under out/<task>/; the tool
adds the exact comment disclaimer. Resolution requires the strict reply
receipt written by review reply, and the receipt must still match the exact
pull request, head, thread, reply, body, and complete bounded review inventory
projection. The parent pull-request UpdatedAt is a nondecreasing floor,
rather than an exact value, because reply side effects can advance it
asynchronously; every review, top-level comment, thread and thread comment, and
review request remains bound.
Reinspect after every mutation and use the newly reported IDs and digests for
the next one.
The one-use reply authority expires no more than five minutes after issuance.
Resolution verifies the authority window and atomically consumes the receipt
before contacting the provider. If a provider read fails or the review epoch advances before any resolution
mutation is attempted, the tool can restore the original unexpired receipt
without replacing another file or extending its authority window. Only an
explicit restoration report permits retry with that receipt; no additional
public reply is needed for that read failure.
Expiration, semantic or full-inventory mismatch, mutation failure, and an
unknown mutation outcome still consume authority. Never recreate the receipt
yourself. Reinspect the remote state and, if resolution remains appropriate,
leave a fresh reasoned reply to obtain new one-use authority.
GitHub provides neither compare-and-swap resolution nor a documented monotonic
review-thread epoch. A human resolve followed by unresolve can therefore be
unobservable if it restores identical thread and pull-request state inside the
five-minute authority window. The exact-state checks, short expiration, and
one-use consumption narrow that risk; they do not prove that such an ABA or a
change to provider metadata omitted from the bounded projection did not occur.
Do not resolve a thread that may be concurrently moderated.
GitHub does not expose atomic compare-and-swap mutations for pull-request
metadata, comments, replies, resolutions, or review requests. The adapter
checks exact expectations before each mutation and verifies the complete
result afterward, but a concurrent human change can still occur inside that
narrow provider-side window. Do not mutate an actively coedited pull request.
Post-mutation inspection failures are reported as outcome unknown; reinspect
instead of retrying blindly.
Forge adapters
GitHub is supported through the gh CLI. Forge behavior is selected behind a
Go interface and uses argument-vector subprocess calls, so another structured
CLI adapter can be added without changing delivery policy. --forge auto
selects GitHub for github.com; use
--forge github --forge-cli <gh-path> to select an explicit executable.
Unknown or unsupported forges fail before any commit rewrite or push.
Version 1 is limited to same-repository pull requests. It cannot reliably
discover or map an upstream pull request whose head lives in a fork. Treat
same-repository topology as a caller-enforced precondition: do not use the
delivery or review commands for a fork-based or otherwise cross-repository
pull request, and stop when remote or pull-request ownership is uncertain.
The adapter fails closed when it observes an unsupported or inconsistent
topology, but that refusal is not a substitute for this caller check.
The read-only provider command recognizes known Forgejo hosts, but there is
currently no Forgejo delivery adapter. Use the repository’s documented
Forgejo compatibility workflow instead of pretending GitHub operations are
portable.
2.4 - OpenSpec
2.4.1 - Specifications
2.4.1.1 - Project al
2.4.1.1.1 - Al Specification
Purpose
Describe AL, the repository command runner that prepares plugin resources and
environment variables, executes a command, and releases those resources.
Sources: project README,
lifecycle contract,
command implementation,
lifecycle manager,
Bazel package, and
toolchain registration.
Baseline source revision: 550d7e79b1f5fdbc2b6017b75178471d6914082f,
observed 2026-09-08.
Requirements
Requirement: Prepare selected plugins before command execution
al run SHALL load its supplied configurations, start the plugins selected by
--plugin_label, and append their environment values to the child command’s
environment before starting that command. It SHALL reject invocation without
a command argument.
- WHEN configuration loading and selected-plugin startup succeed
- THEN the requested command receives its arguments, inherited environment,
Bazel runfiles environment, and prepared plugin environment.
Requirement: Roll back failed resource startup
The lifecycle manager SHALL cancel sibling starts after a startup failure and
attempt cleanup for every attempted resource, including the resource that
failed to start. It SHALL return startup and cleanup failures to its caller.
Scenario: A plugin fails during startup
- WHEN one selected plugin cannot start
- THEN AL does not execute the requested command and releases resources
allocated during the unsuccessful startup.
Requirement: Retain resources until the command stops
AL SHALL wait for its command to exit before stopping plugin resources. On
cancellation it SHALL request direct-child termination, allow up to ten seconds
for shutdown, and kill and reap the child if the grace period expires.
Scenario: Cancel a command using plugin resources
- WHEN the invocation context is cancelled while the command is running
- THEN the command can use its prepared plugin resources during graceful
shutdown, and plugin cleanup follows command termination.
Requirement: Report cleanup failure
Dependency-ordered lifecycle resources SHALL stop in reverse registration
order. AL SHALL include cleanup errors in its invocation result even when the
requested command itself succeeded.
Scenario: Cleanup fails after successful command execution
- WHEN the command exits successfully but a plugin shutdown returns an error
- THEN
al run reports failure rather than treating cleanup as successful.
2.4.1.2 - Project bazel agent
2.4.1.2.1 - Bazel Agent Specification
Purpose
Describe the validated AL Bazel entry point and installation diagnostics used by repository agents.
Sources: project README,
Bazel targets,
command and diagnostic implementation,
and runner tests.
Baseline source revision: 550d7e79b1f5fdbc2b6017b75178471d6914082f,
observed 2026-09-08.
Requirements
Requirement: Validate and preserve Bazel arguments
al bazel SHALL require a recognized Bazel command and insert
--config=agent immediately after that command. Subsequent options, targets,
and arguments after a run separator SHALL pass through unchanged.
Scenario: Run a target with application arguments
- WHEN the caller invokes
al bazel run //path:target -- argument - THEN the runner constructs
bazel run --config=agent //path:target -- argument.
Requirement: Replace the runner with Bazel
The Bazel entry point SHALL resolve bazel from PATH and replace the runner
process with it, preserving the supplied environment without creating or
injecting a host temporary directory.
Scenario: Bazel receives a termination signal
- WHEN a validated invocation starts Bazel
- THEN Bazel owns the runner process and its resulting exit status directly.
Requirement: Report bounded installation diagnostics
doctor SHALL emit a read-only JSON report containing runner and available
built-source identities, Bazelisk pins, platform, configured profile and rc
paths, and task-scratch classification without dumping environment values.
Unavailable built-source identity SHALL remain explicit.
Scenario: Inspect a workspace without a built runner artifact
- WHEN
doctor cannot find the expected Bazel output for the runner - THEN the source report records that it is unavailable rather than claiming
that the installed runner matches current source.
2.4.1.3 - Project dns
2.4.1.3.1 - project-dns Specification
Purpose
Record the retirement of this project’s landing DNS infrastructure while
preserving its repository documentation and builds.
Requirements
Requirement: Keep landing infrastructure retired
The project SHALL have no dedicated landing DNS declaration, Terraform root, or
operational source export. Its documentation SHALL be published by the main site
under /docs/projects/al/ without a separate project landing page.
Scenario: Inspect the project after landing retirement
- WHEN the project tree is consumed
- THEN it contains no landing DNS declaration, Terraform DNS stage, or
landing build target, and the main site owns its documentation.
2.4.1.4 - Review delivery
2.4.1.4.1 - review-delivery Specification
Purpose
Make validated pull-request review delivery reliable and concise while preserving exact-candidate and mutation consistency checks.
Requirements
Requirement: Guarded reply and resolution
The CLI SHALL offer a single review-address operation using a published validation receipt, a thread ID, and a reasoned reply file. It SHALL derive current expectations, post at most one reply per durable reply receipt, and resolve only the verified resulting thread. A retry SHALL resume an existing valid reply receipt rather than posting another reply.
Scenario: Address a finding
- WHEN the published validated head and unresolved thread match the supplied candidate receipt
- THEN the operation posts the reasoned reply, verifies it, resolves the unchanged thread, and returns the resulting inventory
Scenario: Candidate or thread changes
- WHEN the published head differs or the target thread changes during processing
- THEN the operation refuses mutation or stops further mutation with diagnostic state
Requirement: Pre-mutation read recovery
The CLI SHALL preserve the original unexpired reply receipt when a transient provider read or advancing review epoch prevents observing a coherent inventory before any resolution mutation. It SHALL retain single-use consumption on attempted mutations, semantic mismatches, and expiry, without extending authority.
Scenario: Advancing epoch before resolution
- WHEN read-only inventory collection observes an advancing GitHub epoch before resolution
- THEN the operation reports that resolution was not attempted and leaves the original unexpired receipt available for a guarded retry
Scenario: Unknown mutation result
- WHEN a resolution mutation was attempted but its result cannot be verified
- THEN the receipt remains consumed and the tool requires fresh inspection
Requirement: Bounded complete inventory
Review inspection SHALL include every returned thread and comment while fetching the first comment page with the thread page. It SHALL fetch additional comment pages when necessary and retain request, byte, and node limits, identity checks, and duplicate detection.
Scenario: Many ordinary threads
- WHEN every returned thread has one page of comments
- THEN inspection obtains their comments without one separate details request per thread
- WHEN a thread has more comments than its embedded page
- THEN inspection follows its cursor and returns all comments or refuses incomplete state
2.4.1.5 - Ssh release deployment
2.4.1.5.1 - ssh-release-deployment Specification
Purpose
Publish release files and activate archived static websites through the
existing release tool using authenticated SSH and explicit target selection.
Requirements
Requirement: SSH deployment through the release command
The existing release deploy command SHALL use rsync over OpenSSH and accept SSH deployment metadata
alongside existing OCI deployments. An SSH-only deployment SHALL require
neither Ansible nor an OCI executable. It SHALL verify the selected host using
the configured SSH trust mechanism and reuse existing release metadata for
version and file identity.
Scenario: Deploy an SSH-only release
- WHEN a valid SSH release is selected without Soras or Ansible
- THEN the tool deploys over SSH to the explicitly configured environment
- AND an unknown or mismatched host key causes failure before upload
Scenario: Continue using OCI
- WHEN an existing OCI release is deployed
- THEN its existing deployment behavior remains available
The tool SHALL publish each file directly beneath
projects/<project>/releases/<version>/ on the selected host. Regular archives
SHALL remain files. The tool SHALL use rsync over SSH for transfer verification and temporary-file
publication, update existing filenames using rsync semantics, and preserve
unrelated retained files.
Scenario: Publish two ordinary artifacts
- WHEN a release contains a binary and a compressed archive
- THEN both are downloadable under their original filenames in the release directory
- AND the archive is not extracted and no public
files/ layer is added
Scenario: Interrupt or update an upload
- WHEN upload is interrupted
- THEN rsync reports failure and leaves previously completed files available
- AND a later successful run updates the selected filenames without deleting unrelated files
Requirement: Activate a declared website archive
Only the extract step with an explicitly designated website archive SHALL
trigger extraction.
The tool SHALL accept .tar.gz and .zip archives containing a static site
at archive root, preserve the public archive, and publish extracted content
under sites/<project>/releases/<version>/. The link step SHALL select the
completed release by atomically changing sites/<project>/current after
validation.
Scenario: Publish a new static website
- WHEN upload, extract, and link are selected for a valid archive with
index.html - THEN the original archive remains downloadable
- AND the site’s unchanged main URL serves the completed extracted release
Requirement: Reject invalid extraction and preserve the selected site
Unsafe paths, unsupported archive entries, malformed archives, insufficient
space, or missing required site content SHALL cause activation to fail.
Concurrent deployments SHALL NOT corrupt release contents or the selected
link. Failed activation SHALL leave the previous selection intact.
Scenario: Reject an escaping archive
- WHEN a site archive contains traversal, an absolute path, or a link entry
- THEN extraction is rejected without writing outside its staging directory
- AND the selected site remains unchanged
Scenario: Run out of disk space
- WHEN upload or extraction cannot complete because storage is full
- THEN the tool reports failure and preserves previously published content
Requirement: Redeploy retained sites by selecting their release
Running the link step for an existing validated extracted release SHALL
select it through the same deploy command without uploading or extracting it
again. The
version SHALL identify the retained extracted release; changed site content
requires a new version. The tool SHALL NOT introduce a separate rollback
command or delete other releases.
Scenario: Select an earlier retained release
- WHEN an operator runs link for a retained extracted version
- THEN only the site’s selected-release link changes
- AND newer retained releases and their archives remain available
Requirement: Independently selectable publication steps
SSH deployment SHALL accept an ordered subset of upload, extract, and link,
with upload as the default. Extraction SHALL use a published archive, and
linking SHALL select an existing extracted release without local payload files.
Scenario: Prepare a site before selecting it
- WHEN an administrator uploads release files and later runs extract alone
- THEN the archive becomes an extracted versioned site
- AND the current website selection remains unchanged until link is selected
Scenario: Select a retained release independently
- WHEN an administrator runs link alone with a release manifest
- THEN the current symlink selects that existing site version
- AND no archive access or rsync transfer is required
Scenario: Refuse invalid step selection
- WHEN step selection is empty, unknown, duplicated, or out of order
- THEN deployment fails before any remote change
2.4.1.6 - Tool cache
2.4.1.6.1 - Explicit tool installation
Purpose
Record AL’s explicit source-built installation boundary after removal of the
private executable cache.
Requirements
Requirement: Use explicit source-built installation
AL SHALL be built by Bazel and installed only through an explicitly requested
installation target. It SHALL NOT expose al tool or maintain a private executable
cache. Updating source SHALL NOT change an installed executable automatically.
Scenario: Update an installed command
- WHEN an operator requests the repository’s AL install target
- THEN the installer atomically copies the current source-built executable.
- WHEN a caller invokes
al tool - THEN AL reports usage failure without inspecting a tool cache.
2.5 - Proto
Protobuf contracts
2.6 - Release operations
Artifact publication, website operations, preview, and inspection
This package owns artifact identity, the project publication lifecycle, and the
website extraction and activation operations. See
the AL release documentation
for operator commands and their guarantees.
al release publish uploads artifacts; al release website extract creates a retained
site and al release website activate selects it. Each website command supports offline
preview with --dry-run; al release plan previews upload. Mutating commands
can checkpoint --receipt, while a website dry run rejects that flag.
These operations share destination selection and canonical manifest preparation.
Read-only al release inspect keeps local payload
availability independent of the remote snapshot, so operators can investigate
an uncertain publication after local build outputs have been removed.
The observation transport uses the existing strict SSH settings and content
account. Its remote script performs reads only, without locks or staging. Each
captured stream is limited to 16 KiB; overflow cancels the subprocess. Unsafe
filesystem state is reported without repair, while transport and read failures
remain unavailable evidence. A snapshot is not a lease against later changes.
2.7 - Vault resource provider
Invocation-scoped Vault resources for AL’s built-in injector
@rules_al//plugins/vault:config registers the provider executable and its
runfiles. Compose it with AL configuration when resources need Vault. The
repository’s shared //tools/al:config already includes this registration.
Builtin-only calls do not discover or launch an otherwise unselected provider.
Startup initializes handlers and advertises kv, op, oidc, vault_env and vault_ssh without reading
secrets in PluginStartResponse.resource_types; its optional result is absent. ResourceFetch returns ResourceResult directly from opaque settings and declared dependencies;
Vault-specific schema and dispatch remain in this package. The provider uses
generic resource data as the write payload for op resources; args holds
the operation method, path and Vault connection/authentication settings.
The provider uses
AL’s configured Vault connection/authentication, including per-resource
vault_conn and vault_auth settings. Authentication is lazy and issued tokens
remain invocation-owned.
Provider shutdown drains RPCs, revokes owned tokens and removes temporary SSH
material. OIDC requests honor cancellation, verify the configured TLS transport
and reject redirects. Template, authentication and endpoint errors omit secret
values and response contents. no_auth explicitly exports an empty VAULT_TOKEN
so an inherited token is overridden; it does not remove token-helper files.
The AL-owned local Vault and generic provider fixtures verify selected fetches,
resource templates, dependency order, failures, cancellation and cleanup without
contacting live infrastructure. The parent repository separately tests the pinned
Vault dev-server executable at //tools/al:vault_dev_server_test.
3 - Alwaldend.com
Main website and project documentation
Alwaldend.com is the repository’s main website and documentation site. It
uses Hugo with Docsy to publish project documentation through the local and
public download servers.
Historical www architecture
This historical diagram preserves the former Proxmox unikernel deployment; see Deployment for the current website.
The Mermaid source is authoritative; Bazel renders its light and dark SVGs.


Links
Features
The homepage, blog, documentation, and project pages share a flat monochrome
theme with white and charcoal color modes, subtle borders, and system fonts.
The navigation’s theme menu supports light, dark, and system preferences.
Every page uses the centered S8 square monogram from //internal/assets:monogram
in its header and SVG favicon. The header adapts to light and dark modes.
The favicon uses the shared artwork’s high-contrast tab presentation.
Prose links are underlined, and keyboard focus uses a visible outline.
Scrollbars are thin and muted; taxonomy links use small rounded labels shared
with the project index. Documentation sidebars use plain action rows,
uppercase group headings, compact wrapping taxonomy items, subtle hover and active
backgrounds spanning the full tree row, and compact chevrons. Tree labels stay
indented; chevrons expand branches independently of the row’s page link. Headings,
search fields, code blocks, tables, and callouts follow the same typography
and surface styles. Syntax highlighting
uses CSS classes so code colors follow the active theme.
Docsy’s sidebar_root_enabled scopes /docs/<category>/<owner> sections to
their owner’s subtree. One Hugo cascade applies sidebar_root_for: self;
the sidebar root links up to the parent section. Full navigation remains on
the Docs overview. Compact/foldable settings control visibility, while scoped
roots also reduce the HTML sent to readers. All tags remain available.
Documentation Mermaid images use the same light/dark palette and follow the
theme menu, including system preference. They use clean, rounded nodes and
containers, smooth connectors, embedded Liberation Mono lettering, and Mermaid’s
native Dagre layout. Normal graph connectors are 2.25px, while thick, dashed,
invisible, and semantic marker distinctions remain native. Caption plates use
muted borders; sequence lifelines are thinner and grayer than messages.
Mindmaps use the site’s surfaces, text, and connector colors in both modes.
The mermaid_diagram macro in pkg/mermaid/defs.bzl uses the shared
//internal/assets:mermaid_theme target to generate light and dark SVG
and WebP files through the native Mermaid API. The preset supplies
caption styling through themeCSS and places titles on container borders with
Mermaid’s subGraphTitleMargin setting. Compact node/rank spacing and the
pinned renderer’s edgeSpacing option separate nested title plates. Package the
_svg target’s two outputs and reference the light .svg. Markdown and the SVG shortcode recognize
its .dark.svg sibling. The site theme selects the visible image, and print
always uses light. Historical blog diagrams retain their original files and
presentation. Select a diagram’s _webp or _dark_webp target for syndication
and social previews.
The homepage groups links into four sections in one panel. Site follows the
shared header order of Projects, Infra, Blog, and Docs. External links to
GitHub, GitLab, Docker Hub, and Hugging Face.
Projects and Infra link to their indexes and list their entries by creation
date, newest first. The sections form two columns on wider screens and stack on
narrower screens. Each link shows its destination beside its title, or below
it on small screens. The header also links to the Infra index at /infra/,
which shares the Projects index layout and links to infrastructure
documentation under /docs/infra/.
The Mermaid theme gallery shows flowchart,
sequence, state, class, entity-relationship, and mindmap examples in the current
site theme. Each source builds light and dark SVGs for visual comparison.
pkg/mermaid/color-schemes.json saves the Cobalt drafting, Warm editorial,
Teal surfaces, and Violet technical color schemes in both modes. Each has
named canvas, surface, ink, outline, accent, and muted-border colors. This is
an inactive palette catalog; the render macro still selects the neutral
palette and diagram typography from internal/assets/theme.json.
Mermaid geometry and color-role mappings remain in its preset templates,
independently of these saved colors.
Local preview and validation
Run from the repository root:
bazel build //projects/alwaldend.com:site
bazel test //projects/alwaldend.com:site_test
bazel test //projects/alwaldend.com/test/mermaid:mermaid_test \
//projects/alwaldend.com/test/mermaid:readability_test \
//projects/alwaldend.com/test/search:search_test
bazel run //projects/alwaldend.com:site_serve
The preview serves the local build at http://127.0.0.1:1313.
Capture full-page screenshots of the homepage, project landing index, and
project documentation index without a preview server:
bazel run //projects/alwaldend.com:site_screenshots
The default output directory is out/site-screenshots/, containing root.png,
projects.png, docs-projects.png, and screenshots.json. The manifest records
page paths, titles, viewport settings, and actual image dimensions. The command
uses the existing pinned Puppeteer and Chrome, serves only built local assets
through browser request interception, and blocks external origins.
Use --output-dir for a different destination, repeat --path to select pages,
set --width and --height for the viewport, and select --color-scheme dark
for dark-mode captures. For example:
bazel run //projects/alwaldend.com:site_screenshots -- \
--output-dir "$PWD/out/site-review" --path /projects/ --color-scheme dark
bazel test //projects/alwaldend.com/cmd/screenshots:command_test
The offline command test retains real PNGs and a JSON result report in its
Bazel undeclared test outputs.
Build the site’s dependency diagram with
bazel build //projects/alwaldend.com:deps_dark_webp for a dark
WebP, or :deps_webp for light. The companion
:deps_mermaid and :deps_svg targets expose Mermaid and light/dark SVG
outputs. This overview analyzes :site at depth eight, reaching content
packages and repository documentation owners. It omits files, external
targets, tool dependencies, and visibility metadata; it is not the complete
transitive graph. See the
analyzer documentation for options and
the build-cycle reason these artifacts remain outside the site’s own inputs.
Use :deps_mindmap_source, :deps_mindmap_svg, or :deps_mindmap_dark_webp for an
ownership inventory of the same depth-eight targets, grouped by package.
Its branches describe ownership; use the flowchart to trace dependency edges.
The mindmap reuses the existing JSON capture and shared site appearance.
The Mermaid browser check writes screenshots and a JSON report to its Bazel
test outputs. It exercises the theme menu, saved and system preferences,
mobile layout, documentation print output, and blog header and body images.
The readability check measures the six gallery types and semantic edge cases
at article and mobile widths, retaining screenshots and contrast measurements.
The search browser check verifies loading, retry, stale-query handling, result
safety, owner navigation, the complete tag catalogue, and mobile navigation.
These browser checks need no external network.
Search
The build exports Docsy’s complete searchable document corpus, precomputes its
Lunr index, then renders the site with fingerprinted search assets. Preview,
release, and staging use the same content flags for the index and rendered pages;
draft posts remain absent from release and staging search results.
Search starts when its field receives focus. A Web Worker loads the index and
runs queries, keeping that work off the browser’s UI thread. Results retain
Docsy’s fields, ranking, excerpts, exclusions, and configured result limit.
Loading and download failures are visible, and Enter retries a failed request.
No search service or CDN is required. The build compiler and worker both use
Lunr 2.3.9 from the same lockfile; its license ships at /licenses/lunr.txt.
Blog
The site publishes dated articles from content/blog. Each post is its own
Bazel package with an index.md and a BUILD.bazel declaring its
docs_filegroup; the section package aggregates them. The section publishes
HTML, an RSS feed, and a print edition, and appears in the main navigation.
The section index and its posts carry a github_subdir cascade so the
per-page GitHub links point at the content sources.
A post stays unpublished while its front matter declares draft: true. Local
builds render drafts for review and the release build excludes them, so the
draft state alone withholds a post from the deployed site.
A post selects its opening images with front matter images: [pipeline.webp].
The shared blog template displays every entry in order above the article body,
including in the print edition. Hugo’s Open Graph and Twitter card templates
use the same resources for social previews. Do not repeat a header image at
the start of the Markdown body; later illustrations stay in the body.
Every post is encouraged to have a representative image. Reuse an opening
image when available, preferring a raster projection for social cards. Posts
without a suitable image can omit this metadata. Bundled resource parameters
provide descriptive alternative text and an optional visible caption:
images:
- pipeline.webp
resources:
- src: pipeline.webp
params:
alt: The uploader pipeline
Set params.caption when an image needs a visible caption. Without params.alt,
the image uses the page title as alternative text. Header images use the shared
image renderer and scale to the available width.
Header image files use a 5:2 canvas, matching the current
X Article cover display.
This is a display ratio, not an API upload restriction. Keep the complete
illustration inside the canvas without cropping or stretching. Mermaid header
renders set aspect_ratio = [5, 2]; arrange their content for a wide canvas
before adding the minimum padding needed to reach that ratio. Other body
illustrations keep their natural dimensions.
Agent workflow: Add a blog post.
Projects
The site publishes each registered project’s visitor-facing landing page at
/projects/<name>/, with the section index at /projects/. Each project owns
its landing content in projects/<name>/site/content/; this site packages
those directories into content/projects/<name>/ from the registry in
projects/projects.bzl. Landing content carries no layouts,
styles, or build rules, and participates in the shared statuses,
languages, and tags taxonomies.
Project README statuses declarations use the shared
project lifecycle catalog. The repository inventory
updater derives each landing’s status field from its README and checks freshness;
edit the README and regenerate rather than editing generated landing status.
Taxonomy aliases retain the former in_progress, finished, and abandoned URLs.
Every project landing declares its creation date explicitly as date: YYYY-MM-DD
in front matter. The homepage project links and /projects/ index use that
date to list newer projects first. Routine page edits preserve the creation date.
Repository reference documentation, including each project README, stays under
/docs/projects/<name>/. Because every landing is part of this one build, a
content error in any landing fails the whole site build and the blog
deployment.
Documentation links
Markdown links and images resolve relative to their source directory.
Documentation images select matching .dark.svg, .dark.png, and .dark.webp
siblings through the shared theme menu; print pages use the light image.
README.md and _index.md links resolve to generated pages; packaged resources
use their published URLs, including when embedded in print pages. Link files
that exist only in the repository with explicit GitHub URLs. Unknown internal
destinations remain unchanged rather than being silently redirected to GitHub.
Print pages scope IDs and their fragment and control references to each source
document, keeping anchors distinct when documents are combined.
During site packaging, plain documentation that starts with an H1 receives a
derived Hugo title. Missing ancestor section pages preserve its directory
hierarchy, including OpenSpec specifications. Existing front matter and leaf
bundles remain authoritative. The title is rendered once and its original
heading anchor remains available; canonical Markdown needs no site metadata.
Tree disclosure controls support pointer clicks and keyboard toggling.
The tag index wraps its items, and /404.html offers links back to the site.
Deployment
Prepare a clean nightly or release version using the
release workflow, then build a portable website
release bundle from the repository root:
bazel build --config=release //projects/alwaldend.com:release
The output directory bazel-bin/projects/alwaldend.com/release contains
release.json and files/website.tar.gz. The manifest uses STABLE_VERSION
from the versioning tool, including 0.0.0-dev for development builds.
The archive contains the complete site with index.html at its root and
excludes drafts, generated project release pages/manifests, and project binary
payloads. Release artifacts remain on the download server. The release target
requires release configuration. Building
it does not connect to a host or publish anything.
With repository Vault authentication available, publish the bundle to XCP-ng:
bazel run //infra/download:publish.local -- \
--release_dir "$PWD/bazel-bin/projects/alwaldend.com/release"
bazel run //infra/download:website.extract.local -- \
--release_dir "$PWD/bazel-bin/projects/alwaldend.com/release" \
--site_archive website.tar.gz
bazel run //infra/download:website.activate.local -- \
--release_dir "$PWD/bazel-bin/projects/alwaldend.com/release"
After local verification, use //infra/download:sync.yandex to mirror local
content to the public host. The wrappers inject short-lived SSH credentials and
strict host trust. AL owns immutable publication; synchronization is the download
component’s explicit authoritative Ansible operation. See
AL release procedures for destination overrides
and independent upload, extraction, and activation steps.
The manifest version selects both the archive and extracted site. Identical
publication retries verify existing bytes. Changed content requires a new version
or explicit deletion of an inactive release. Activation retains earlier sites;
roll back with their manifest and website.activate.local. Development 0.0.0-dev bundles
can be inspected, but publication requires a nightly or release version even for
the first local deployment. Follow the
versioning workflow.
The bundle is intentionally separate from the generated release documentation:
including the website archive in its own documentation would create a build
cycle. The Pages commands below remain available during the staged migration.
- DNS setup: infra/dns
- This project’s DNS declaration
owns the shared
pages address. Project landing pages are published by this
site under /projects/<name>/, so no project owns a CNAME or a dedicated
hostname. The project directory links to every landing page.
The apex and www records stay managed centrally. - Deploy to the Github Pages repo (the
pages branch of
alwaldend/alwaldend.github.io, which GitHub Pages serves):bazel run --config=release //projects/alwaldend.com:deploy
The deploy script clones the pages branch, replaces its contents with the
built site, writes .nojekyll, and pushes only when the output changed.
Update PVE VMs
bazel run //projects/alwaldend.com/tf # Apply tf
bazel run //projects/alwaldend.com/tf:update_pve_disk # Update the disk
Taxonomy
| Taxonomy | Meaning |
|---|
| Categories | General category |
| Languages | Programming language |
| Sites | Sites |
| Statuses | Project status |
| Tags | Generic tags |
Shortcodes
alwaldend/alert
{{< alwaldend/alert >}}
Alert body
{{< /alwaldend/alert >}}
alwaldend/label_link
Create a link using a bazel label
Usage:
{{% alwaldend/label_link "//tools/qt" %}}
alwaldend/links
Render common links
Usage:
alwaldend/svg_file
Render a packaged SVG using its published URL. Set alt to describe the image;
the page title is the fallback.
Usage:
{{< alwaldend/svg_file file="local_file.svg" alt="Project architecture" >}}
alwaldend/include_html
Include a local html file
Usage:
{{< alwaldend/include_html "file.html" >}}
alwaldend/docs_misc_books
Render books
Usage:
{{< alwaldend/docs_misc_books >}}
3.1 - alwaldend.com DNS
Owner-local DNS Terraform
This root manages the records in dnsconfig.json using
//projects/alwaldend.com/dns:tf.<operation>. Follow the
shared transfer procedure
before operating this root.
3.2 - Mermaid theme gallery
Six diagram types rendered with the current flat site theme
These fictitious document-service examples share the site’s current
flat theme and
palette. The site selects light or dark
images with its theme menu. Open an image to inspect its native size.
The examples carry structure and labels only; appearance belongs to the theme.
Labels use embedded Liberation Mono, including when an image is opened alone.
Normal graph paths use 2.25px strokes, captions have muted frames, sequence
guides recede behind messages, and mindmap branches keep visible contrast in
both modes. Dense diagrams still benefit from opening the full-size image.
The five graph examples also have interactive 3D views with solid nodes, spatial paths,
and volume outlines for groups. These views use the same palette and embedded
font. Drag to orbit, right-drag to pan, scroll to zoom, or select an element to
trace its connections. Each HTML file works offline.
Flowchart
Branching decisions, a container, two data stores, and dashed revision/retry
paths test arrow direction, caption weight, and route separation.
Source · Interactive 3D · 3D snapshot · Dark snapshot.


Sequence
Calls, dashed replies, an activation, a self-call, an alternative, a loop,
and a note test the distinction between messages and structural guides.
Source.


State
A composite processing state, retry cycle, cancellation, and terminal markers
test transition labels and nested boundaries. Source · Interactive 3D · 3D snapshot · Dark snapshot.


Class
An interface, implementation, dependency, association, and composition test
open and filled markers, dashed lines, and cardinality labels.
Source · Interactive 3D · 3D snapshot · Dark snapshot.


Entity relationships
Identifying and non-identifying relationships, optional cardinality, and
attribute tables test crow’s-foot markers and fine table separators.
Source · Interactive 3D · 3D snapshot · Dark snapshot.


Mindmap
Three ownership branches and two leaf levels test branch visibility and the
site’s explicit surfaces and text colors. Branches represent grouping, not data flow.
Source · Interactive 3D · 3D snapshot · Dark snapshot.


Rebuild
From the repository root:
bazel build //projects/alwaldend.com/docs/mermaid-theme:samples
bazel build //projects/mermaid_3d/samples:html //projects/mermaid_3d/samples:snapshots
bazel build //projects/alwaldend.com:site
The first target produces six SVGs and their .dark.svg siblings. The second
produces five self-contained HTML files and ten light/dark PNG snapshots. The
site target packages this page and all formats. Generated files remain build outputs; the six .mmd files are
authoritative. Mermaid 3D owns the spatial renderer.
3.3 - Tf
Terraform
This service stage retains its tf=main authentication, including Proxmox login.
Manage records through the dedicated DNS root.
Offline formatting is available through
//projects/alwaldend.com/tf:tf_tests.fmt_test.
4 - Android launcher
Text-only Android launcher built with Kotlin and Jetpack Compose
A text-only Android launcher built with Kotlin and Jetpack Compose. It lets
you hide apps and runs without ads, tracking, or internet access.
Links
Features
- Android app
- Kotlin, Jetpack Compose
- Only text
- FOSS, no ads, no internet access, no tracking, minimal dependencies
- Allows you to hide apps
Release APK
Build from the selected releases/YYYY.W branch using the
weekly release workflow. Bazel stamps the
release version and derives its Android version code before packaging.
bazel build --config=release //projects/android_launcher/cmd/launcher:launcher_binary
mkdir -p out/release-apks
bazel run //projects/android_launcher:sign_apk -- \
--input bazel-bin/projects/android_launcher/cmd/launcher/launcher_binary_unsigned.apk \
--output out/release-apks/android_launcher.apk
The signing target uses the app’s existing certificate and
Vault Transit key.
5 - Anki as code
Export and reconcile Anki collections as TOML
Anki as code exports collections as protobuf-backed TOML, plans changes, and
reconciles them through Anki’s native API. It accepts modern .colpkg archives
containing collection.anki21b and offline collection databases such as
collection.anki2. Keep Anki and other writers closed during export, state operations,
apply, and build. Plan, config dump, and state dump use stdout; status and errors use stderr.
Configuration paths identify objects, similar to Terraform. Native IDs live in
Anki and collection-backed state; note GUIDs remain Anki metadata. New files
create new objects; explicit moves retain existing identities and review progress. Apply/build leave
all configuration files unchanged. New notes and their note types can be created
in the same apply, without generating or writing identities into source.
Collection operations live under col (alias collection): col export,
col plan, col apply, col build, and col state. The namespace flag
--state-key belongs to this group. Text-only operations use config (alias
conf), such as conf dump. Collection source flags remain specific to each
operation: --collection for existing collections and --base for builds.
The CLI reference has a short index and
one child page per root subcommand, each containing its complete nested help,
including the generated Anki API tree. Bazel generates these pages from the
Cobra definitions with tools/generate_cli_docs and packages the hierarchy
with the documentation; generated Markdown is not checked in. Build it with
bazel build //projects/anki_as_code/docs:cli_reference.
Optional server engines
WebAssembly CLI
Build the Go CLI itself for WASI Preview 1 with both bundled servers disabled:
bazel build -c opt --//projects/anki_as_code:wasm=true //projects/anki_as_code
This produces a wasip1/wasm module. The public alias uses select() to choose
a go_cross_binary target that cross-compiles the existing server-free command.
Other targets in the same invocation keep their normal platform and server-engine settings. This
selection excludes both bundled servers regardless of the anki_grpc engine flags.
Find the module path with
bazel cquery -c opt --//projects/anki_as_code:wasm=true //projects/anki_as_code --output=files.
Run it with a WASI Preview 1 runtime and grant access to the configuration
directory. For example, with the repository-pinned wazero CLI:
bazel run @com_github_tetratelabs_wazero//cmd/wazero -- run \
-mount "$PWD/configs:/configs:ro" /absolute/path/to/wasi \
config dump --text /configs
Help and file-only config export/config dump commands work without Anki.
No native server, embedded Rust WASM server, or self-spawned default worker is
included. Standard Go WASI cannot spawn subprocesses or dial TCP/Unix sockets,
so collection and API operations require additional host integration. This is
a WASI command, without browser JavaScript bindings.
Bundled server selection
The independent booleans //projects/anki_grpc:cgo (default true) and
//projects/anki_grpc:wasm (default false) compose available engines in the
public command. Build a pure-Go host executable with the bundled WASM server:
bazel build -c opt //projects/anki_as_code --//projects/anki_grpc:cgo=false --//projects/anki_grpc:wasm=true
The default worker uses cgo when available and otherwise runs the complete Rust
CLI/server through WASM in the same executable. Both generic subprocess and
in-process strategies prefer cgo. With neither engine, the command supports explicit external
clients and reports that local engines are unavailable. The executable owns
its scoped client factory, worker arguments and supported subprocess schemes.
subprocess+wasm:// and subprocess+cgo:// select their named compiled engine
for an explicitly encoded application worker, including when both are enabled.
Their factories supply --server-engine=wasm or --server-engine=cgo before
the worker arguments when the encoded executable resolves to this application,
including filesystem aliases. An independently supplied executable retains its
exact arguments; its caller owns engine selection. For example, a standalone
anki_grpc worker still receives just serve. The generic subprocess scheme
also preserves its argument vector.
For direct server hosting, use anki_as_code --server-engine=cgo server run serve
or select wasm the same way; omit the selector for the preferred compiled engine.
Use --address inprocess+wasm://collection to execute the same Rust server in
the application process over in-memory gRPC streams. Generic inprocess://
prefers cgo when available and otherwise uses WASM; qualified schemes select
their engine explicitly. Each client owns fresh state and closes its runtime
after the operation. The default remains the supervised subprocess.
The WASM adapter owns building and embedding its guest and exposes Run(arguments);
application code handles no module bytes. Only the guest targets WASI. Guest
and host follow normal Bazel compilation modes; -c opt optimizes both. Offline
collection, package and local media operations are supported. Network-dependent
Anki services return explicit unsupported errors. Keep exclusive access to
collection and media paths: the WASI SQLite VFS does not coordinate process locks.
ANKI_WASM_CACHE_DIR optionally selects a caller-protected compiled-code cache.
Native server
The native Linux x86_64 application build links the Rust server into its executable. By default,
collection operations launch the same executable with server serve and communicate over stdio.
The installed CLI needs no companion worker, PATH lookup, or executable extraction.
The CLI also accepts --address inprocess://collection or
--address inprocess+cgo://collection for collection workflows and API calls.
Each operation gets fresh native state without launching a worker. A managed API
path can accompany any client address. A network address selects the server where
the collection is opened and closed; address-only access leaves collection lifetime
with the caller. Native work can outlive cancellation, so source reservations remain
held until native cleanup finishes. Configured subprocess execution remains the default.
Reusable application libraries stay pure Go. Callers that want direct execution
import the optional anki_grpc/pkg/ankigrpc/native subpackage for registration.
App and Store use the shared ankigrpc.NewClient constructor; they keep no native
engine map or concrete adapter constructor. Subprocess connection strings encode their exact
executable and arguments with ankigrpc.SubprocessAddress; local in-process labels
remain opaque and never identify shared state.
bazel build -c opt //projects/anki_as_code produces an optimized
executable with final symbol and debug information stripping. It uses the host
Linux runtime libraries, including OpenSSL 3.
server shows the available server operations. server run forwards arguments
to the linked Rust CLI, which owns native subcommands and their help.
For server serve, CLI prepends serve before calling App.ServerRun.
Cobra forwards arguments without interpreting native flags:
anki_as_code server run --help
anki_as_code server serve --help
anki_as_code server serve --transport tcp --listen 127.0.0.1:50051
anki_as_code server serve --transport unix --listen ./anki.sock
Stdio is the default and reserves stdout for gRPC. TCP and Unix listeners use
plaintext gRPC and require an explicit address. The child process keeps native
failures and shutdown separate from the application workflow.
Collection commands accept optional --address ADDRESS to use an already running
Anki gRPC server. Omit it or use an empty value to keep the embedded default.
The flag belongs to col (alias collection) and is inherited by export, plan,
apply, build and every state command:
anki_as_code col plan --address 127.0.0.1:50051 --collection /shared/collection.colpkg --text ./text
anki_as_code col apply --address tcp://127.0.0.1:50051 --collection /shared/collection.colpkg --text ./text
anki_as_code col state dump --address unix:///shared/anki.sock --collection /shared/collection.anki2
External addresses accept host:port, tcp://host:port, unix://PATH or an
absolute Unix socket path. Local addresses accept subprocess:// and, when the
native engine is compiled, subprocess+cgo://; WASM-enabled commands also accept
subprocess+wasm://. Qualified application-worker schemes select that engine
for same-executable workers before forwarding the encoded server arguments;
independent executables retain their arguments. External connections use plaintext gRPC. An explicit address never
falls back to the embedded worker; interrupt the command to cancel connection
startup if the server is unavailable.
The CLI opens and closes the collection for each command and closes its client
connection afterward. It leaves the external server process running. Reserve
the server exclusively for the command, with no collection already open.
The CLI and server must access the same absolute filesystem paths, including
collection/media files, CLI TMPDIR for package restores, and build output
directories for staged archives. Files are not transferred over gRPC.
Build-selected command source files import ankigrpc/native for native hosting
and client scheme registration; main.go owns signals and worker configuration.
The reusable application library imports only pure Go packages, including when
//projects/anki_grpc:cgo is enabled. Set that independent boolean to false to
exclude native linkage; local hosting remains available when WASM is enabled. The executable name stays anki_as_code.
MCP server
anki_as_code mcp serve exposes workflow tools and an individual tool for every
declared native Anki RPC over stdio. The pinned catalog contains 281 tools:
269 declared RPCs, ten workflows and two collection-session controls. Forwarded
aliases are omitted; methods declared on Backend services remain available.
An MCP client launches the executable; stdout contains protocol messages and
stderr contains command diagnostics. Discovery needs no running Anki instance,
collection, or optional server engine.


A client configuration can launch an installed executable like this:
{
"mcpServers": {
"anki_as_code": {
"command": "/absolute/path/to/anki_as_code",
"args": ["mcp", "serve"]
}
}
}
Workflow tools are config_dump, config_export, col_export, col_plan,
col_apply, col_build, col_state_dump, col_state_import,
col_state_update, and col_state_replace. Inputs use server-side paths:
collection, text, output, and base have the same meanings as their CLI
flags. state_key selects the binding namespace. Config export takes a structured
configs object; state update/replace take a structured state object; state
import takes a bindings object mapping config paths to native ID strings.
Use col_open with collection and an optional address to open a
collection once. It returns an opaque handle, which native tools and the
collection/state workflows accept instead of collection and address:
{ "handle": "collection-1", "request": { "did": "1" } }
Pass the handle to col_close when finished. Its worker and connection
remain open between calls, and enabled archives are published on close.
Disconnect closes all remaining handles. write_back defaults to true on
col_open; set it to false there to disable archive publication.
Database writes remain immediate. Handle calls cannot include collection,
address, or write_back; col_build continues to require an independent base
archive path. Configuration-only tools do not use a handle.
Native tool names are api_<service>_<method>, replacing CLI hyphens with
underscores and retaining backend_ for methods declared on those services.
Canonical names remain unchanged when forwarded aliases are omitted. For example,
api_notes_get_note accepts:
{
"collection": "/absolute/path/to/collection.anki2",
"request": { "nid": "1234567890123" }
}
Native calls require a handle, collection or address; the latter two can select a managed source
and its backend. address alone uses that backend’s current collection.
Requests and responses use protobuf field names and ProtoJSON values, including
string-encoded 64-bit integers and base64 bytes. The compiled descriptors supply
each tool’s nested request and response schema. Responses include structured
JSON and a text JSON fallback; operations without a return value produce {}.
The SDK’s stdio reader limits individual request frames to 16 MiB; clients can
apply separate limits to responses.
Keep Anki and other collection writers closed. Path-based access retains
per-call collection lifetime and publication. Explicit handles reserve their
source until close, serialize operations on that collection, and reuse the
prepared connection through the existing App methods. The shared App rejects
other managed access to the same source until native cleanup finishes.
Existing backend capability and path-based explicit open/close restrictions
apply. Native write_back defaults to true and controls archive publication;
false does not undo database writes. Workflow archive reads can repackage their
source during cleanup. Errors and cancellation do not imply rollback, and the
server does not automatically retry mutations. Cancellation and disconnect allow
existing bounded native cleanup before shutdown.
Upstream API commands
api <service> <method> constructs its command tree from the compiled Go
protobuf descriptors for all 25 pinned Anki schemas. Bazel automatically generates
the registration imports into internal/rpc from the pinned descriptor set using
the project-local tools/generate_anki_schemas generator;
no separate generation step or runtime schema files are needed. Service/method names use
kebab-case, omit the Service suffix and retain backend- prefixes. Implicit
backend methods are included. Help lists request fields and message types;
no proto files or server discovery are needed.
anki_as_code api tags all-tags --collection ./collection.colpkg
anki_as_code api notes get-note --collection ./collection.anki2 \
--input request.toml --input-format toml --output-format json
anki_as_code api notes get-note --address unix:///path/to/anki.sock \
--input request.json
Exactly one nonempty --collection or --address is required. An omitted or
empty address retains embedded access with the supplied collection. Offline access starts
the same executable with server serve and owns the collection lifetime. --address accepts a TCP
host:port, tcp://host:port, unix:///absolute/path or an absolute Unix socket
path. It uses the server’s current collection and closes only the client
connection. Explicit open/close/import RPCs require connected access.
Unix URI paths can be relative, such as unix://anki.sock.
App resolves methods, validates payloads and owns remote client connections directly; collection.Store manages only
offline collection scopes.
Input defaults to stdin (--input -); JSON is the default input and output
encoding. An empty request body is accepted for empty request messages.
--timeout bounds input reading, startup and the request, defaulting to 30 seconds. Responses
use stdout after cleanup succeeds; request, publication and cleanup errors use
stderr and a nonzero exit status. Native error details are preserved.
Offline archive write-back is enabled by default. --write-back enables it
and --no-write-back disables it; the last occurrence wins. Explicit boolean
values such as --write-back=false are also accepted. Disabling write-back
skips automatic .colpkg publication; native RPCs keep their normal effects.
.anki2 mutations always commit directly. Requests are not
transactions: earlier committed changes can persist even when a later RPC fails.
Onboarding an existing collection
Export a full .colpkg from Anki, then close Anki and other collection writers.
Use a fresh text directory so stale declarations from earlier exports are not
included. Export configs and their native bindings together:
bazel run //projects/anki_as_code -- col export \
--collection /absolute/path/collection.colpkg --output /absolute/path/text \
--state-output /absolute/path/state.anki.toml
bazel run //projects/anki_as_code -- col state update \
--collection /absolute/path/collection.colpkg /absolute/path/state.anki.toml
bazel run //projects/anki_as_code -- config dump \
--text /absolute/path/text
# Edit the TOML files before planning and applying.
bazel run //projects/anki_as_code -- col plan \
--collection /absolute/path/collection.colpkg --text /absolute/path/text
bazel run //projects/anki_as_code -- col apply \
--collection /absolute/path/collection.colpkg --text /absolute/path/text
# Alternatively, build a separate archive instead of applying in place.
bazel run //projects/anki_as_code -- col build \
--base /absolute/path/collection.colpkg --text /absolute/path/text \
--output /absolute/path/rebuilt.colpkg
Export reads collection resources and stored state through Anki’s API; managed
source archives may be repackaged. Callers choose the output locations and own
their existing contents. Declared config files are overwritten in place, while
unrelated entries remain untouched. The optional state file contains version-1
TOML bindings for every exported deck, note and note type, including
field/template identities and referenced
scheduling preset aliases. It uses the exact generated filenames, including
collision suffixes and names retained from the selected state namespace.
col state update installs those bindings into the same collection before you
edit configs. This preserves existing object identities and review progress
when you later apply changes. Use the same --state-key for export, state
update, plan, apply and build if selecting a custom namespace.
After editing, inspect col plan, then use col apply to update the supplied
collection or col build to write a separate archive. After apply, import the
updated archive into Anki; after build, import rebuilt.colpkg. Collection-backed
bindings travel with the archive.
Omit --state-output for config-only export. Use col state import for selective
manual bindings. Generated state belongs to the collection it was exported
from; do not install it into an unrelated collection. State update merges
bindings and retains omitted entries; col state replace intentionally removes
omitted bindings. For an already managed collection, review exported state
before installing it, especially if paths have changed.
--state-output names a TOML file, regardless of its extension. Current-user
~ paths are supported. The file may live outside the text directory or inside
it under an unrelated name such as state.anki.toml. Export rejects state paths
that conflict with config declaration filenames or directories needed by exported
configs. State output is atomically replaced after config export succeeds.
Filesystem failures may leave partial configs; a failed config export retains
the previous state output. The config tree and state file are not published as
one filesystem transaction.
Use absolute paths with bazel run, which can start outside the checkout.
Current-user ~ and ~/... paths are supported. --text accepts a collection
root file or its directory. config dump defaults to JSON; --format toml is
also available. The CLI starts its linked server through its own executable path.
No Python is required.
Collection and output paths resolve symbolic links before subsequent ..
components. Configuration loading rejects symbolic links, including before ..,
instead of silently selecting a lexically normalized configuration directory.
Configuration-set export
config export [FILE] --output DIRECTORY writes a serialized
CollectionConfigSet as the fixed TOML hierarchy. Input defaults to JSON;
--format toml accepts a TOML-encoded config set. Omit FILE or use - to read
stdin. The conf alias works for both dump and export. These commands operate
without opening Anki.
anki_as_code config dump --text ./configs > configs.json
anki_as_code config export configs.json --output ./copy
anki_as_code config dump --text ./configs | anki_as_code config export --output ./copy
The caller supplies complete configs with valid, unique collection-relative
paths. Schema decoding happens before writes; collection semantics and path
validation remain the caller’s responsibility. Export overwrites declared files
and retains unrelated entries. Filesystem failures can leave partial output;
callers can export to a temporary directory when they need staged publication.
Status goes to stderr and stdout stays empty.
App.ConfigExport(ctx, output, configs) exposes the same writer for Go callers
through config.Store.Export, without changing the supplied protobuf object.
State operations
State commands accept an existing offline .anki2 database or .colpkg archive
through --collection. Commands call App’s typed state workflows. App borrows
one prepared connection from collection.Store, which reserves the source and
constructs the native worker and collection backends.
Collection cleanup finishes before transport cleanup and source reservation
release. State stores borrow the connection and own no native lifetime or files.
Databases are opened directly and committed writes persist in place, including
when a later operation fails. Packages are restored into a temporary directory
and written back during cleanup through Anki’s atomic package API, including media.
Publication runs independently of request outcomes and may repackage unchanged
content. Normal cleanup removes restored files; publication failures or uncertain
native completion follow the backend library’s retention/error contract.
Missing files and non-regular inputs fail before startup. Anki validates package
contents during restore. Cleanup uses a bounded context independent of command
cancellation, and operation and cleanup errors are preserved. Keep Anki and other
writers closed during these operations. Collection export and reconciliation use the same native workflow.
anki_as_code col state dump --collection /path/to/collection.anki2 > state.anki.toml
anki_as_code col state import --collection /path/to/collection.anki2 --text /path/to/configs \
decks/Default/deck.anki.toml=1 notes/example.note.anki.toml=123
anki_as_code col state update --collection /path/to/collection.anki2 state.anki.toml
anki_as_code col state replace --collection /path/to/collection.anki2 state.anki.toml
Dump returns stored bindings without writes or discovery. An absent namespace
returns empty version-1 state. TOML is the default; --format json selects JSON.
Update and replace read FILE or stdin when omitted/-. Status and errors use
stderr; dump uses stdout.
Import accepts multiple PATH=ID arguments, resolves declared config paths before
interpreting native identifiers, checks the requested existing objects and saves
once after the complete batch succeeds. IDs remain strings at the CLI/Go API
boundary; Anki currently requires positive int64 IDs. Note-type imports include
native field/template bindings. Existing scheduling presets use presets/<alias>
addresses. Import does not edit config files or native objects.
Update merges external version-1 state: omitted map keys remain, supplied keys
replace their complete entry, including note-type member maps. Replace installs
the whole object and removes omitted bindings. It can repair invalid saved state;
invalid replacement input and native read failures still fail before writing.
Validation rejects conflicting path/native ownership before writes.
Empty updates and identical operations
perform no state write. Native notes, cards, scheduling, history, presets and
media remain owned by Anki.
Missing or unknown state subcommands fail with nonzero status and stderr output.
Explicit col state --help succeeds.
--state-key KEY selects a namespace; the default is anki_as_code/state/v1.
Only that key is written. Callers coordinate concurrent writes to the same key.
State uses separate typed maps under State.Resources:
version = "1"
[resources.decks."decks/Default/deck.anki.toml"]
id = "1"
[resources.notes."notes/example.note.anki.toml"]
id = "123"
[resources.note_types."note_types/Basic.notetype.anki.toml"]
id = "456"
[resources.note_types."note_types/Basic.notetype.anki.toml".fields.Front]
id = "789"
[resources.presets.Default]
id = "1"
api/ankiascodeapi provides ankiascodeapi.App, the shared interface for
configuration, collection, state and server workflows. pkg/ankiascode provides
the concrete ankiascode.App. Its zero value supports configuration operations
and borrowed connections. Path access requires a configured factory or an explicit address;
hosting the server requires an injected ServerRunner.
Supply ankiascode.Options{FS: storage} to use an afero.Fs for every
application-owned filesystem operation, including config discovery/read/write,
collection source inspection, export/state output and build staging/publication.
For example:
storage := afero.NewMemMapFs()
application := ankiascode.New(ankiascode.Options{FS: storage})
err := application.ConfigExport(ctx, "/configs", configs)
data, err := application.ConfigDump(ctx, "/configs", "json")
Configuration operations run entirely in that storage and need no Anki server.
Custom filesystem paths retain their own namespace, including relative paths
and literal ~; they do not use the host home or working directory. Nil selects
afero.NewOsFs() and preserves existing OS path expansion, including for a
zero-value App. Callers retain ownership of the filesystem and coordinate access.
BasePathFs aliases resolve within its virtual namespace, including directly
nested bases. Equivalent absolute and relative virtual names use one canonical
relative spelling. Parent traversal and symlink targets outside that base are
rejected during reads and writes, including configuration export.
internal/filesystem.FS keeps the Afero backend private and owns shared path
handling, file/directory I/O and temporary names. App constructs this wrapper once
and supplies it to every internal filesystem owner. afero.Fs in the public
options is an interface that callers can implement with their own storage.
Server and backend-library filesystem implementations remain separate: injecting
storage does not transfer files to a backend or make its native paths accessible.
Managed collection operations still require the backend to access the selected
collection and staging paths. CLI input files and standard streams belong to the
CLI adapter, outside App.
ankiascode.New(ankiascode.Options{NewClient: factory.NewClient}) injects an
ankigrpc.ClientFactory constructor function. It receives each operation’s address
unchanged. A concrete Factory’s method value preserves its configured default
and private registrations. Use ankigrpc.ToClientFactory for a constructor
returning a concrete client, or pass a function returning StartableClient directly.
Without a configured factory, explicit addresses use ankigrpc.NewClient.
The executable registers its subprocess schemes and imports direct native adapters; App delegates raw
client startup and bounded cleanup to ankigrpc.WithClient; the collection store
owns managed collection scopes.
Collection workflows accept one ankiascodeapi.CollectionOptions value:
Path selects a managed database/archive and optional Address selects the client
used to prepare it. Empty per-operation addresses let the injected factory select its default.
Alternatively, Connection borrows an already-open collection; it cannot be
combined with a path or address. StateKey selects the namespace, with an empty
value selecting the default. App validates these combinations before opening
resources and retains no endpoint between calls. Path selects managed collection
lifetime, Address selects the client, and Connection borrows an already-open collection.
Managed API calls use the same source semantics as other collection operations.
The CLI registers its worker schemes and supplies its own executable and
[]string{"server", "serve"} through the injected factory for its default. Operations follow the CLI namespaces: ConfigDump, ConfigExport,
ColExport, ColPlan, ColApply, ColBuild, ColStateDump, ColStateImport,
ColStateUpdate, ColStateReplace, APICall and ServerRun.
Creating an options value performs no I/O. ColBuild requires a base archive in
options.Path and forwards a copy of those options with its staged path to apply.
internal/cli owns the complete Cobra tree, flags, binding syntax, formats and
streams. Configuration, collection, API and server commands call
ankiascodeapi.App; MCP commands use a private interface owned by CLI.
The App interface uses shared options values, strings, protobuf
messages and standard-library types. Commands wrap collection path flags
without opening resources. App owns server delegation and composes
collection/configuration workflows; the lower-level packages retain their domain
and lifecycle responsibilities. CLI passes parsed operation options into the
injected App; the executable owns concrete construction and native adapters.
cmd/anki_as_code constructs App and the CLI, owns its scoped client factory,
and injects the configured server runner through Options.ServerRunner. The
default worker prefers cgo and otherwise uses WASM; qualified schemes select
their compiled engine explicitly.
The executable also owns process signal handling. App.ServerRun checks startup
cancellation, builds the argument vector and invokes that runner. Serving owns
the worker process until return or termination; its context controls entry only. App does not link Rust/cgo or change
process-global signals. Missing runner configuration fails before native hosting.
Isolated command tests supply one fake without constructing App or starting Anki.
Commands pass namespaces explicitly, and App retains no command configuration.
factory := ankigrpc.NewFactory(ankigrpc.SubprocessAddress(serverPath, "serve"))
factory.RegisterClientFactory("subprocess", ankigrpc.ToClientFactory(ankigrpc.NewSubprocessClient))
var application ankiascodeapi.App = ankiascode.New(ankiascode.Options{NewClient: factory.NewClient})
options := ankiascodeapi.CollectionOptions{Path: absoluteCollectionPath, StateKey: key}
// ConfigDump(ctx, path, format) works without a native backend.
value, err := application.ColStateDump(ctx, options)
err = application.ColStateImport(ctx, options, absoluteConfigPath, bindings)
err = application.ColStateUpdate(ctx, options, external)
err = application.ColStateReplace(ctx, options, replacement)
App’s path-based operations return after cleanup. Borrowed connections remain
owned by their caller, including after failure or cancellation. Operations read
fresh collection data and neither close the borrowed connection nor publish a
package. Callers coordinate access and decide when to save and close; direct
database writes persist immediately and multiple calls are not a transaction.
One App can alternate between several open collections:
first := ankiascodeapi.CollectionOptions{Connection: firstConnection, StateKey: key}
second := ankiascodeapi.CollectionOptions{Connection: secondConnection, StateKey: key}
err := application.ColStateUpdate(ctx, first, external)
report, err := application.ColPlan(ctx, first, absoluteConfigPath)
other, err := application.ColStateDump(ctx, second)
The protobuf contract lives in api/ankiascodepb, with Go package
ankiascodepb and protobuf namespace anki_as_code. Message names and fields
retain the existing config and state formats; Go imports and protobuf fully
qualified type names use the renamed API.
ColExport(ctx, options, output, stateOutput) accepts an empty
stateOutput for config-only export or a TOML file path for snapshot bindings.
Callers own both output locations and their existing contents for managed paths
and borrowed connections. Config/state output conflict checks still apply.
internal/collection.Store reserves existing sources and owns enabled archive publication.
Configure its default client or pass a per-operation address before collection access. WithCollection injects a prepared
grpc.ClientConnInterface into its callback. Construct the services you need on
that connection and reuse local instances for several operations.
collection.New(collection.Options{NewClient: factory.NewClient}) configures client
construction and default selection. No executable or server arguments are
discovered by the application or store. Without a configured factory, path-only
access fails before client startup; explicit addresses remain usable. Each scope
constructs a fresh transport client and a single-use application collection scope. ankigrpc.WithClient uses the same
factory and bounded transport cleanup for raw addressed API access without
entering the store or reserving a collection. Managed scopes close native
storage before stopping the worker. Collection publication and close have a ten-minute default budget, configurable
with Options.CollectionCloseTimeout; transport cleanup has a separate five-second budget
independent of callback cancellation; source reservations outlive cleanup.
store := collection.New(collection.Options{NewClient: factory.NewClient})
err := store.WithCollection(ctx, ankiascodeapi.ColOpenOptions{Path: path, WriteBack: true}, func(connection grpc.ClientConnInterface) error {
resources := resource.New(connection)
states := state.New(connection, key)
exporter := export.New(resources, states, filesystem.FS{})
if err := exporter.Export(ctx, directory, ""); err != nil {
return fmt.Errorf("export configs: %w", err)
}
if _, err := states.Replace(ctx, replacement); err != nil {
return fmt.Errorf("replace bindings: %w", err)
}
return nil
})
Callbacks return only an error and finish all work sequentially before returning.
WriteBack alone controls archive publication; domain change results do not affect
collection cleanup. Retained connections
reject calls after cleanup. Resource/state stores and exporters borrow the
connection; each operation reads fresh data. A Store or App must not be copied
after use. Duplicate canonical paths and file aliases are rejected within one
Store; callers coordinate access across different stores and external writers.
Store.Open and WithCollection use ankiascodeapi.ColOpenOptions for the source
path, address and WriteBack policy. Enabled write-back
publishes the source archive during cleanup independently of callback results, errors
and cancellation. Application workflows explicitly enable it; API flags select it.
Database writes persist immediately, including before later errors; the scope is
not a transaction. To export another archive destination, use Anki’s
ExportCollectionPackage with the injected connection as the final operation and
disable WriteBack when source publication is unwanted. Native export consumes the
open collection; application scope cleanup handles it.
App.APICall(ctx, ankiascodeapi.APIRequest{...}) exposes the same generic operation
without per-method wrappers. Supply a fully qualified gRPC Method, Input bytes and
JSON/TOML encodings. Collection is the shared CollectionOptions value: exactly
one of Collection.Path, Collection.Address, or Collection.Connection is
required for raw API calls. An address selects an app-owned connection to the
server’s current collection. WriteBack defaults to false for Go callers; the CLI explicitly
selects true. Borrowed native connections retain caller-owned cleanup and
publication. Request validation precedes native startup.
State Go API


internal/state borrows a prepared connection and owns no process, collection
lifecycle or files. The selected namespace defaults when the key is empty:
store := state.New(connection, "")
value, err := store.Dump(ctx)
changed, err := store.Import(ctx, configs, map[string]string{
"notes/example.note.anki.toml": "123",
})
changed, err = store.Update(ctx, external)
changed, err = store.Replace(ctx, replacement)
Dump, Update and Replace exchange *ankiascodepb.State. Import accepts a parsed
*ankiascodepb.CollectionConfigSet and path/ID strings. Multiple calls reuse the
same prepared connection. The changed flag reports whether state was written.
State.Resources groups typed deck, note, note-type and preset maps; note types
own field/template maps.
state.Export(configs, snapshot, identities) generates version-1 bindings from
projected configs, their path-to-native-ID map and the same native snapshot.
State owns construction and validation of resource and member bindings,
including scheduling preset aliases. This pure operation performs no backend
calls and installs no state. Collection export owns config paths and file output.
Collection lifecycle
For path sources, App delegates native access to collection.Store.WithCollection.
App.ColOpen(ctx, ColOpenOptions{Path, Address, WriteBack}) delegates to
Store.Open and returns an already-open ankiclient.Client handle with
Connection and Stop. Its private scope owns one source and one transport.
WithCollection defers Stop around its callback, including error and panic paths.
ankiclient.StartableClient embeds Client and adds Start for transport owners.
Collection publication and cleanup remain application guarantees of ColOpen.
The application scope opens databases directly or restores packages through
Anki into temporary storage. Stop publishes enabled archives, closes storage and
stops the transport under independent cleanup budgets. Its caller can stop waiting
without cancelling owned cleanup. Session cancellation also initiates cleanup.
The Store keeps source reservations until private native-completion tracking
confirms release; no public restart, collection-phase or Done method is exposed.
Generated services borrow the prepared connection. Active calls remain concurrent;
cleanup drains registered callers, tracks consuming native close/export calls and
retains uncertain restores with a diagnostic. Owned transports can establish final
completion through concrete Done methods, observed by a private interface in the
collection package. Closing an external
network connection cannot establish completion of uncertain native work; recovery
requires external server cleanup before restoring application access.
Enabled archive publication runs independently of callback outcomes. Anki writes
and atomically replaces that archive. Database operations persist in place. Build
separately stages its base, applies to the copy and atomically replaces its output
after success. Failed builds preserve the destination. Callers coordinate access
across different applications and external writers.
Export and explicit moves
Export reads the collection and writes configuration TOML to caller-owned paths.
--state-output optionally writes matching snapshot bindings for onboarding.
Existing stored bindings retain note and note-type filenames on re-export.
New note types receive unused filenames with numeric
suffixes when their names collide with tracked paths, including case-only
differences and fallback names. Without bindings, native edits can change
content-derived filenames.
Export selects a note’s directory from its first regular card. Card generation or
changed destinations can therefore change an exported path, including when Anki
chooses a deck for a new root note. When adopting these new paths, declare
[[moved]] entries from their stored paths before applying. Export does not
rewrite bindings. Applying the same root-note configs again preserves native
identity and converges; Anki owns their initial deck selection.
Follow onboarding to bind the whole export
before the first reconciliation, or use col state import for selective
bindings. New configs without bindings describe new objects.
State dump exports stored bindings separately; it does not discover bindings
for an untracked config tree:
bazel run //projects/anki_as_code -- col state dump \
--collection /absolute/path/collection.colpkg > /absolute/path/state.anki.toml
Export writes declared files directly through config.Store.Export and does not reload
generated files. Other entries remain untouched, including old configs and state
files other than an explicit --state-output destination. Callers own output
locations and their existing contents. Filesystem errors may leave partial output.
Use a fresh destination for a clean snapshot. For directory cleanup or
synchronization, export to a temporary directory and use rsync or another
external tool; those policies belong to the caller.
To rename or move a resource without replacing it, move its file/directory and
add a root [[moved]] pair. Directory moves include descendant notes/decks; type
moves include their members. Fields/templates use addresses such as
note_types/Basic.notetype.anki.toml#fields/Front. Update readable references in
the same edit. Moves require independent, nonoverlapping endpoints, reject
occupied destinations, and are idempotent when retained. The old source must no
longer be declared. Remove a completed move before reusing its old path.
Managed and unmanaged entities
- Notes: add/remove tracked notes; edit exact named fields and tags shared by
their generated cards. Only tracked notes missing from configs are removed.
- Regular-deck assignments: move generated cards using note defaults and
template/cloze ordinals. Card entries assign decks and do not declare existence.
Before deleting a deck containing retained cards, declare a surviving destination
for them. An omitted assignment keeps the card and its existing deck.
- Decks: create, rename/move, remove, and edit normal or filtered configuration.
Titles derive from the fixed hierarchy. A deck must be empty in Anki before
conversion between normal and filtered kinds. Native APIs must support the requested
removal; required native objects cannot silently become untracked.
Planning rejects removal of the tracked native default deck (ID
1), even
when renamed; retain its declaration or use an explicit move. - Note types: create, rename, remove, and edit ordered fields, templates,
CSS, browser fonts, and upstream presentation settings. Explicit member moves
preserve field/template identities. Edit affected named note fields together.
Existing notes cannot switch to another native note type through this CLI.
These are excluded from editable desired state:
- Resident filtered cards: membership, home decks, and temporary scheduling
belong to Anki. Their assignments are omitted. Empty the filtered deck before
removing referenced resources or changing a resident card’s template structure.
- Scheduling presets: referenced by readable names; never created, deleted,
or edited. The CLI calls no preset-writing API.
- Existing card scheduling/state and review history: preserved in the database
to retain study progress. Anki initializes cards it generates for new notes/templates.
- Media payloads: preserved through Anki’s native package APIs. Field references are
editable; media creation/deletion is outside the workflow.
- Collection/UI/sync settings and native metadata: owned by Anki and omitted
from text. API operations update their normal bookkeeping as needed.
- Untracked objects: preserved during apply. Import them before edits that
would destroy their references, such as deleting a deck with untracked cards,
renaming a parent with untracked children, or changing shared field/card structure.
Publication and planning
Plan reads an API snapshot, resolves config references and moves, checks owned
relationships, and compares requested resources in memory. It performs no native
mutations, writes no bindings and creates no database copy. It reports paths,
resource changes and known card deck assignments. card_generation_deferred
indicates that Anki determines generated-card effects during apply; the planner
does not claim exact creation/removal counts for those effects.
Anki performs final template validation, normalization and card generation during
apply. Planning can therefore accept a template that apply rejects. Source values
that Anki normalizes can remain different from stored values in subsequent plans;
accepted values are never written back into TOML.
Database apply updates the supplied collection directly. Anki commits each native
operation, so later errors can leave earlier operations committed. Archive apply
uses Anki’s atomic package export during cleanup. Earlier committed changes can
persist after later request failures; read operations may repackage unchanged content. Build requires
a distinct archive output and stages its copy before Apply, publishing the completed
archive atomically after success. Keep other writers closed while using a collection;
the CLI does not detect concurrent archive replacement.
Collection export writes its declared config files in place. It does
not traverse, clean or replace the destination directory. Other entries remain
untouched, and filesystem errors may leave partial output. Callers can export to
a temporary directory and synchronize it externally when required.
Converged database apply leaves source bytes unchanged. Note-type comparison
ignores runtime ordinal hints and unmanaged metadata while retaining explicit
field/template identity changes. New notes use Anki’s batch creation API.
Export reads stored bindings and optionally writes a separate state file; it does
not install bindings through Anki’s API.
Failed native reads or projection leave existing output unchanged.
Fixed hierarchy
collection.anki.toml
note_types/
Basic.notetype.anki.toml
notes/
unattached.note.anki.toml
decks/
Languages/
deck.anki.toml
notes/
introduction.note.anki.toml
decks/
French/
deck.anki.toml
notes/
greeting.note.anki.toml
The root contains version, currently 1. Optional moves describe file, directory,
or nested definition address changes for reconciliation:
version = "1"
[[moved]]
from = 'decks/Old'
to = 'decks/Languages'
decks/Languages/decks/French/ declares Languages::French. Every deck directory
requires deck.anki.toml. Titles come from the hierarchy and are absent from
markers. A normal deck references an existing scheduling preset by readable name:
preset = 'Default'
[normal]
description = 'Language lessons'
Notes reference note types by configuration path and contain exact named fields:
note_type = 'note_types/Basic.notetype.anki.toml'
[fields]
Front = 'Bonjour'
Back = 'Hello'
[[cards]]
ordinal = "0"
An omitted card deck inherits its declaring deck’s marker path. Explicit card
and template overrides use paths such as decks/Languages/deck.anki.toml.
Note types declare names, upstream configuration, ordered fields and templates.
sort_field selects a field by name; template target_deck references a deck path.
Array order determines field/template positions.
Paths identify resources. Editable configs contain no top-level Anki IDs or note
GUIDs. A note at a new path declares a new resource; identity-preserving moves
belong in the root’s moved list. Explicit state operations install bindings
inside the collection; export writes configs only.
The identity generation command has been removed.
The loader lists immediate files in notes/ and note_types/, descending only
through child decks/. Other files and deeper note directories are ignored.
Missing resource directories are empty sets. Empty markers are parseable;
business logic determines whether they are usable. Symlinks, non-directory
resource roots, and missing deck markers fail.
The format is unreleased and stays version 1 while the schema evolves. Only the
current schema is supported. Normal/filtered settings and note-type presentation
reuse Anki messages. Native-only fields in reused messages are omitted by collection
export and rejected by reconciliation; pure dump/export retains supplied protobuf
values without semantic checks.
Serialization and package APIs


These operations work with configuration files and protobuf objects without
opening Anki. Load checks syntax, schema, version, and filesystem layout; callers
own collection semantics. Dump calls Load and serializes the complete parsed set.
Export can write a caller-supplied object directly without loading it first.
Read, encoding, and filesystem failures end the operation with an error. Export
may leave partial output; it does not validate relationships or clean up files.


The class diagram shows root and resource configuration messages. References
use paths; card and template deck references target normal decks. Each note stores
shared field content and tags, while note types define ordered fields, templates,
and presentation. The root marker contains the version and explicit moves.
Attached notes identify each file’s location in the fixed hierarchy. In Load,
each file is decoded as it is read, and deck titles and omitted card deck paths
are derived inside the deck loop. Dump selects JSON or TOML encoding for the
complete configuration set.
TOML decodes to generic values, then JSON, then protobuf using ProtoJSON.
Unknown keys and incompatible values fail. Unquoted TOML dates/times fail rather
than silently becoming strings; quote dates used as note text. Output converts
ProtoJSON directly to TOML, preserving optional presence and exact text values.
64-bit values use quoted decimal strings, including version = "1".
config.New(root, storage) returns a *config.Store bound to a configuration path and
a filesystem.FS without
accessing the filesystem. Use a directory for writing; reads also accept a root
config file. The store exposes:
Load() (*ankiascodepb.CollectionConfigSet, error) parses the hierarchy.Dump(format string) ([]byte, error) loads and encodes JSON or TOML.Export(configs *ankiascodepb.CollectionConfigSet) error writes the root
marker and supplied path/config pairs as TOML files beneath its directory.
store := config.New(absoluteDirectory, storage)
configs, err := store.Load()
data, err := store.Dump("json")
err = store.Export(configs)
Pass filesystem.FS{} for OS storage or filesystem.New(storage) for an Afero
backend. Discovery, regular-file and alias checks, directory
creation, reads and writes use the selected filesystem throughout.
Stores retain no parsed messages or open files. Each Load reads fresh values;
callers own filesystem coordination and the returned messages. config.Version
supplies the supported schema version to collection exporters.
Export writes directly, preserves input messages, overwrites declared files, and
leaves unrelated/stale files alone. Callers own output locations and existing
contents, valid and unique paths, layout, validation, staging, cleanup, and
publication. Export does not load or normalize its output; failures may leave
partial files. Consumers use the store;
the layout package remains an implementation API with restricted Bazel visibility.
config/layout owns the fixed hierarchy, discovery, file I/O, and direct file
export. internal/codec converts TOML/JSON through protobuf without filesystem
access. Config layout, config dump, state CLI commands, and collection export
reuse its format dispatch; TOML/JSON helpers are private. Dependencies flow from
config to layout/codec and from layout to codec. State stores have no serialization
dependency.
Collection relationship validation and native operations remain outside them.
Architecture


The executable contains CLI, MCP and App. Ordinary CLI commands call App;
mcp serve starts MCP, whose tools call the same App while an agent communicates
over stdio. App reads and writes Configs and uses gRPC to access Server, which
owns Anki storage, including native resources and persisted application state.
Server abstracts the in-process, subprocess and external-server variants. Its
position here expresses the application boundary; the
backend selection diagram shows where each variant runs
and how it connects.
Package dependencies
The project keeps one Go module with focused packages. Configs and state are
protobuf contracts. Runtime resolution models stay private to internal/plan; packages expose only operations used by their consumers.


Each package’s doc.go describes its responsibilities and boundaries; this
diagram shows how the packages compose.
Dotted edges show calls through injected contracts. Solid
edges show component dependencies.
| Package | Responsibility |
|---|
cmd/anki_as_code | App construction, CLI invocation and process signals |
internal/cli | Cobra commands, application dispatch and streams |
internal/mcp | Stdio MCP tools, protocol envelopes and descriptor-derived schemas |
internal/collection | Source reservations and archive publication |
api/ankiascodepb | Generated config, plan, and persisted-state contracts |
api/ankiascodeapi | Shared application interface and collection source contracts |
pkg/ankiascode | Application workflows and service composition |
internal/export | Native-to-config projection and direct file output |
internal/plan | Pure resolution, comparison, ownership and prepared operations |
internal/reconcile | Execute protobuf plans, bind native IDs and persist state |
internal/rebuild | Apply to a staged archive copy and publish it atomically |
internal/resource | Native generated clients and fresh resource snapshots |
internal/config | Root-bound configuration Store for Load, Dump, and Export |
internal/config/layout | Fixed hierarchy, discovery, file I/O, and direct export |
internal/filesystem | Injected storage, path expansion and filesystem-local aliases |
internal/rpc | Compiled upstream descriptor catalog and protobuf RPC execution |
internal/codec | Filesystem-independent protobuf/TOML/JSON conversion |
internal/state | Stored-state dump, import, update, and replacement |
The command entry point constructs App and passes it to internal/mcp.New.
It passes App and the resulting concrete server into internal/cli. CLI owns
the private mcpServer interface with Serve(context.Context) error for its
MCP command group; protocol tools call App. This interface is local to CLI
and is not part of ankiascodeapi.
App has no MCP dependency or MCP hosting method.
App obtains a prepared connection from
the supplied source and constructs its services locally. Path sources use
collection.Store; borrowed sources retain caller-owned lifetime. export.New(resources, states, filesystem.FS{}) constructs an
Exporter using caller-provided resource and state stores. Its
Export(ctx, output, stateOutput) method owns native-to-config projection,
filenames and direct config output, with optional snapshot bindings written as
TOML. State installation remains separate.
Export has no dependency on reconciliation.
plan.Build(configs, snapshot, stored) constructs prepared protobuf operations
without I/O. reconcile.New(resources, states) constructs a Reconciler whose
Apply(ctx, compiled) method executes them and returns whether native data or
bindings changed. App shares config loading, capture and plan preparation between
plan and apply within one collection scope. Planning owns reference resolution,
comparison and ownership; execution owns native calls and returned identities.
Config and codec have no Anki runtime dependency. State owns stored path bindings,
not lifecycle or serialization. App uses the Go backends in
projects/anki_grpc and Anki’s collection/package services; Resource owns generated resource clients and fresh native snapshots.
The executor borrows resource/state stores and owns no process or filesystem resources. There is no archive facade or handwritten ZIP/Zstandard
handling. Anki owns storage compatibility, normalization, structural migrations,
field caches, and card generation. No HTML cache rebuilding or SQLite driver is
implemented in Go. The application does not force Check Database after import;
normal Anki API updates maintain their caches.
Planning Go API


plan.Build(configs, snapshot, stored) returns an executable protobuf
CollectionPlan from caller-supplied configs, a resource snapshot and stored
bindings. It performs no I/O and leaves all inputs unchanged. Callers capture
fresh inputs under exclusive offline access to the same collection and namespace.
Backend lifetime belongs to the caller; planning can run with the backend open or closed.
The plan separates expected_state from proposed_bindings and contains a change
report, prepared deck/type/note operations, name releases, tracked deletions and
card destinations. New objects have zero native IDs; prepared note-type and
template-deck references use configuration paths. Resource comparison produces
operations and report entries together. Converged plans have no native operations.
Card destinations are included only for known changes or relevant native generation.
Planning indexes native protobufs directly and resolves desired configs into the
prepared protobufs used for comparison and execution. Returned payloads are
independent of supplied inputs; path/ID indexes and ownership checks stay private
to internal/plan.
Member moves rename fields or templates within one note type; cross-type identity
transfers are rejected. Stable native member IDs are authoritative. Without IDs,
matching uses original stored names, including before explicit renames; stale
ordinals cannot claim another current member. Ambiguous bindings fail before a
plan is returned. Untracked resources and resident filtered cards stay unmanaged,
including deck targets referenced by untracked templates. All cloze card ordinals
share template zero; resident cards block template replacement or removal, while
explicit template moves that preserve identity remain allowed.
Anki owns native validation, normalization, structural migrations and card generation.
The report compares current card destinations and cards removed with deleted notes;
template-driven additions, removals and migrations remain deferred through
card_generation_deferred. Prepared operations do not simulate those native effects.
The CLI and App’s ColPlan return the report; Go services pass the complete plan to
reconcile.New(resources, states).Apply(ctx, compiled).
The executor checks expected stored state before writes, executes prepared operations,
resolves new native IDs and persists bindings. It never loads configs, captures a
resource snapshot, matches members or recomputes the plan. Native metadata and
newly generated cards are read only as needed to execute it. A private applier
reads the supplied plan unchanged, clones the proposed bindings, and copies only
note-type requests whose native identities or presentation need updating. Reports,
expected state and note bodies are not cloned. Callers retain exclusive access and
own freshness beyond stored-state checks.
compiled, err := plan.Build(configs, snapshot, stored)
changed, err := reconcile.New(resources, states).Apply(ctx, compiled)
Archive build Go API
internal/rebuild stages a separate collection archive using an injected apply operation:
builder := rebuild.New(apply, filesystem.FS{})
err := builder.Build(ctx, baseArchive, outputArchive)
The non-nil callback receives a private .colpkg path and must finish all native
work and close its session before returning. Builder knows nothing about configs,
Anki clients or reconciliation. Callers own home-path expansion and exclusive
source/destination access; the destination parent must already exist.
Builder checks the regular source file and rejects source/destination aliases,
copies into a private directory beside the destination, then publishes the
completed archive with an atomic rename. Apply errors, cancellation observed
before publication and publication failures leave the original and existing
destination intact. Staging is removed on return, including panic unwinding;
cleanup errors are retained. Cancellation preserves both the context error and
its custom cause for errors.Is. Atomic publication does not guarantee power-loss
durability. The App callback delegates to ColApply.
Run bazel test //projects/anki_as_code/internal/rebuild:rebuild_test.
The native E2E changes real Anki state in the staged archive and emits original,
changed and unchanged .colpkg files plus a decoded JSON state object.
Native resource Go API
internal/resource shares generated native clients and complete snapshots on a
caller-owned prepared connection:
resources := resource.New(connection)
snapshot, err := resources.Snapshot(ctx)
note, err := resources.Notes.GetNote(ctx, ¬es.NoteId{Nid: noteID})
Store exposes the generated deck, note-type, note, card and rendering clients
without forwarding wrappers. Search and preset clients remain private snapshot
dependencies. Snapshot returns upstream protobuf objects, including unmanaged
resources and resident filtered cards; Snapshot.Presets retains the public map of
preset identities to names.
Decks are ordered by title; note types, notes and cards by native ID. Each call
reads fresh values and returns caller-owned results. There is no cache or atomic
snapshot guarantee; callers provide exclusive offline access.
The resource store owns no backend lifecycle, state bindings, configs, projection,
planning or mutation order. Export and reconciliation retain those policies.
No SQL or duplicate storage logic is involved.
Collection export Go API


internal/export borrows resource and state stores for the same prepared collection:
resources := resource.New(connection)
states := state.New(connection, key)
exporter := export.New(resources, states, filesystem.FS{})
err := exporter.Export(ctx, absoluteOutputDirectory, absoluteStateFile)
Stored bindings retain filenames and preset aliases.
Export(ctx, directory, stateFile) writes configs and optional bindings from
the same snapshot as TOML. An empty state destination selects config-only
behavior. Export never installs state; state operations remain separate.
Callers own output locations and their existing contents.
New note filenames use Anki’s HtmlToTextLine result for the configured sort
field. Go only sanitizes that text into a bounded Unicode filename. Bound names
are reused from state; filename conversion never changes stored note fields.
Export owns config projection and readable filenames and delegates file output
to config.Store.Export. It overwrites declared configs in place and leaves other
entries untouched, including stale configs and state files other than the
explicit state destination.
Filesystem errors may leave partial output. For cleanup or publication policies,
export to a temporary directory and synchronize it externally, for example with
rsync. The caller also owns exclusive offline access, backend startup,
collection preparation and shutdown.
Export and reconciliation share resource.Store for generated clients and fresh
native snapshots; their projection and policy remain separate.
Backend selection
This diagram groups explicit strategies by dependency. External TCP/Unix clients
require no optional local engine. Every enabled engine supplies its subprocess
and in-process strategy, including in combined builds. Cgo defaults to enabled;
WASM defaults to disabled. Generic subprocess:// and inprocess:// both prefer
cgo and fall back to WASM when cgo is unavailable.


Explicit TCP and Unix addresses connect to an external server without starting
or linking a local engine.
With --//projects/anki_grpc:wasm=true, subprocess+wasm:// selects a worker
hosting the Rust server through wazero, including in combined builds.
inprocess+wasm:// hosts the same
server inside the application process through wazero and in-memory gRPC streams.
Disable cgo as well for a pure-Go executable.
With --//projects/anki_grpc:cgo=true, native in-process clients and the
subprocess+cgo:// worker remain available, including in combined builds.
In-process calls use the Go gRPC interface
and cross the C ABI directly, without a network transport or child process.
Generic inprocess:// uses this native client when cgo is available and falls
back to WASM when only WASM is available. With neither engine it is unavailable.
Anki backend API
The reusable Go backend and Rust server belong to
projects/anki_grpc. The Go package owns the
server process and exposes a managed gRPC connection. Callers use Anki’s generated
service clients for typed methods. Anki owns collection validation, note updates,
card generation, and persistence; this CLI owns TOML and reconciliation.
Integration approaches considered
Direct storage editing has the simplest integration: an application edits
SQLite and protobuf itself, taking responsibility for Anki’s data invariants and
business logic. The API-based approaches are Python with Anki’s official SDK,
Rust with Anki’s Rust API, and another language with a translation layer around
the Rust API. The two Rust API approaches require building Anki from source.
A translation layer can be a C ABI or a gRPC sidecar; it does not remove that
build requirement.
This project uses a translation layer: the Go CLI calls the Rust server in
projects/anki_grpc, which forwards operations to Anki’s Rust API. Go owns the
server process and its failures.


The maintained Mermaid source is rendered by the
:backend_approaches Bazel target and published with the project documentation.
Verification
bazel build -c opt //projects/anki_as_code
bazel test -c opt //projects/anki_as_code/...
E2E targets use Bazel’s default shard count. Opt into parallel Go E2E execution
with a count appropriate for the host, for example:
bazel test -c opt --test_sharding_strategy=forced=4 \
//projects/anki_as_code/pkg/ankiascode:ankiascode_test \
//projects/anki_as_code/pkg/ankiascode:wasm_workflow_test \
//projects/anki_as_code/cmd/anki_as_code:cli_workflow_test \
//projects/anki_as_code/cmd/anki_as_code:wasm_cli_workflow_test \
//projects/anki_as_code/cmd/anki_as_code:composed_cli_workflow_test
Use -c opt for these suites: the default fastbuild mode compiles Rust and its
embedded WASM guest without optimization. Each shard shares a private WASM
compilation cache among its workers. Bazel’s job and resource settings bound
the number of shards running concurrently.
Synthetic native E2E verifies reviewed-card/history/preset/media retention, filtered
cards, field/template migrations, copied notes, config-only export and independent state operations,
import/moves, untracked-object safety, read-only configs, convergence, rejected
publication, large fields/archives, and Anki’s actual full-package round trip.
CLI E2E verifies streams, flags, removed generation, and pure config behavior.
Repeatable TOML, JSON, and collection artifacts are emitted through Bazel’s
undeclared test outputs. Exact-candidate delivery receipts own validation status.
The independent exporter E2E uses a caller-managed native backend and collection.
It checks exact Unicode/multiline fields, presentation, member bindings, stable
bound/discovered paths, native filename text conversion, filtered-card exclusion,
read-only state namespaces, untouched existing entries, cancellation and partial output
after filesystem errors. It emits a complete text tree and a native .colpkg artifact.
Run bazel test //projects/anki_as_code/internal/export:export_test.
5.1 - CLI reference
Export and reconcile Anki collections as TOML
Choose a command to see its usage, options, and complete nested help.
api — Invoke upstream Anki services using protobuf JSON or TOMLcol — Inspect and manage Anki collectionsconfig — Inspect and manipulate collection configuration fileshelp — Help about any commandmcp — Expose workflows and native Anki API tools over MCPserver — Manage the Anki server
5.1.1 - api
Invoke upstream Anki services using protobuf JSON or TOML
anki_as_code api
Invoke upstream Anki services using protobuf JSON or TOML
Usage:
anki_as_code api [command]
Available Commands:
ankidroid anki.ankidroid.AnkidroidService
backend-anki-hub anki.ankihub.BackendAnkiHubService
backend-ankidroid anki.ankidroid.BackendAnkidroidService
backend-ankiweb anki.ankiweb.BackendAnkiwebService
backend-card-rendering anki.card_rendering.BackendCardRenderingService
backend-cards anki.cards.BackendCardsService
backend-collection anki.collection.BackendCollectionService
backend-config anki.config.BackendConfigService
backend-deck-config anki.deck_config.BackendDeckConfigService
backend-decks anki.decks.BackendDecksService
backend-frontend anki.frontend.BackendFrontendService
backend-github anki.github.BackendGithubService
backend-i18n anki.i18n.BackendI18nService
backend-image-occlusion anki.image_occlusion.BackendImageOcclusionService
backend-import-export anki.import_export.BackendImportExportService
backend-links anki.links.BackendLinksService
backend-media anki.media.BackendMediaService
backend-notes anki.notes.BackendNotesService
backend-notetypes anki.notetypes.BackendNotetypesService
backend-scheduler anki.scheduler.BackendSchedulerService
backend-search anki.search.BackendSearchService
backend-stats anki.stats.BackendStatsService
backend-sync anki.sync.BackendSyncService
backend-tags anki.tags.BackendTagsService
card-rendering anki.card_rendering.CardRenderingService
cards anki.cards.CardsService
collection anki.collection.CollectionService
config anki.config.ConfigService
deck-config anki.deck_config.DeckConfigService
decks anki.decks.DecksService
frontend anki.frontend.FrontendService
i18n anki.i18n.I18nService
image-occlusion anki.image_occlusion.ImageOcclusionService
import-export anki.import_export.ImportExportService
links anki.links.LinksService
media anki.media.MediaService
notes anki.notes.NotesService
notetypes anki.notetypes.NotetypesService
scheduler anki.scheduler.SchedulerService
search anki.search.SearchService
stats anki.stats.StatsService
tags anki.tags.TagsService
Flags:
-h, --help help for api
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Additional help topics:
anki_as_code api anki-hub anki.ankihub.AnkiHubService
anki_as_code api ankiweb anki.ankiweb.AnkiwebService
anki_as_code api github anki.github.GithubService
anki_as_code api sync anki.sync.SyncService
Use "anki_as_code api [command] --help" for more information about a command.
anki_as_code api anki-hub
anki.ankihub.AnkiHubService
anki_as_code api ankidroid
anki.ankidroid.AnkidroidService
Usage:
anki_as_code api ankidroid [command]
Available Commands:
flush-all-queries /anki.ankidroid.AnkidroidService/FlushAllQueries
flush-query /anki.ankidroid.AnkidroidService/FlushQuery
get-active-sequence-numbers /anki.ankidroid.AnkidroidService/GetActiveSequenceNumbers
get-column-names-from-query /anki.ankidroid.AnkidroidService/GetColumnNamesFromQuery
get-next-result-page /anki.ankidroid.AnkidroidService/GetNextResultPage
insert-for-id /anki.ankidroid.AnkidroidService/InsertForId
run-db-command /anki.ankidroid.AnkidroidService/RunDbCommand
run-db-command-for-row-count /anki.ankidroid.AnkidroidService/RunDbCommandForRowCount
run-db-command-proto /anki.ankidroid.AnkidroidService/RunDbCommandProto
Flags:
-h, --help help for ankidroid
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api ankidroid [command] --help" for more information about a command.
anki_as_code api ankidroid flush-all-queries
/anki.ankidroid.AnkidroidService/FlushAllQueries
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api ankidroid flush-all-queries [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for flush-all-queries
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid flush-query
/anki.ankidroid.AnkidroidService/FlushQuery
Request: anki.generic.Int32
Response: anki.generic.Empty
Request fields:
val: optional sint32
Usage:
anki_as_code api ankidroid flush-query [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for flush-query
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid get-active-sequence-numbers
/anki.ankidroid.AnkidroidService/GetActiveSequenceNumbers
Request: anki.generic.Empty
Response: anki.ankidroid.GetActiveSequenceNumbersResponse
Usage:
anki_as_code api ankidroid get-active-sequence-numbers [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-active-sequence-numbers
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid get-column-names-from-query
/anki.ankidroid.AnkidroidService/GetColumnNamesFromQuery
Request: anki.generic.String
Response: anki.generic.StringList
Request fields:
val: optional string
Usage:
anki_as_code api ankidroid get-column-names-from-query [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-column-names-from-query
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid get-next-result-page
/anki.ankidroid.AnkidroidService/GetNextResultPage
Request: anki.ankidroid.GetNextResultPageRequest
Response: anki.ankidroid.DbResponse
Request fields:
sequence: optional int32
index: optional int64
Usage:
anki_as_code api ankidroid get-next-result-page [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-next-result-page
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid insert-for-id
/anki.ankidroid.AnkidroidService/InsertForId
Request: anki.generic.Json
Response: anki.generic.Int64
Request fields:
json: optional bytes
Usage:
anki_as_code api ankidroid insert-for-id [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for insert-for-id
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid run-db-command
/anki.ankidroid.AnkidroidService/RunDbCommand
Request: anki.generic.Json
Response: anki.generic.Json
Request fields:
json: optional bytes
Usage:
anki_as_code api ankidroid run-db-command [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for run-db-command
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid run-db-command-for-row-count
/anki.ankidroid.AnkidroidService/RunDbCommandForRowCount
Request: anki.generic.Json
Response: anki.generic.Int64
Request fields:
json: optional bytes
Usage:
anki_as_code api ankidroid run-db-command-for-row-count [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for run-db-command-for-row-count
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankidroid run-db-command-proto
/anki.ankidroid.AnkidroidService/RunDbCommandProto
Request: anki.generic.Json
Response: anki.ankidroid.DbResponse
Request fields:
json: optional bytes
Usage:
anki_as_code api ankidroid run-db-command-proto [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for run-db-command-proto
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api ankiweb
anki.ankiweb.AnkiwebService
anki_as_code api backend-anki-hub
anki.ankihub.BackendAnkiHubService
Usage:
anki_as_code api backend-anki-hub [command]
Available Commands:
ankihub-login /anki.ankihub.BackendAnkiHubService/AnkihubLogin
ankihub-logout /anki.ankihub.BackendAnkiHubService/AnkihubLogout
Flags:
-h, --help help for backend-anki-hub
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-anki-hub [command] --help" for more information about a command.
anki_as_code api backend-anki-hub ankihub-login
/anki.ankihub.BackendAnkiHubService/AnkihubLogin
Request: anki.ankihub.LoginRequest
Response: anki.ankihub.LoginResponse
Request fields:
id: optional string
password: optional string
Usage:
anki_as_code api backend-anki-hub ankihub-login [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for ankihub-login
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-anki-hub ankihub-logout
/anki.ankihub.BackendAnkiHubService/AnkihubLogout
Request: anki.ankihub.LogoutRequest
Response: anki.generic.Empty
Request fields:
token: optional string
Usage:
anki_as_code api backend-anki-hub ankihub-logout [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for ankihub-logout
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid
anki.ankidroid.BackendAnkidroidService
Usage:
anki_as_code api backend-ankidroid [command]
Available Commands:
debug-produce-error /anki.ankidroid.BackendAnkidroidService/DebugProduceError
flush-all-queries /anki.ankidroid.BackendAnkidroidService/FlushAllQueries
flush-query /anki.ankidroid.BackendAnkidroidService/FlushQuery
get-active-sequence-numbers /anki.ankidroid.BackendAnkidroidService/GetActiveSequenceNumbers
get-column-names-from-query /anki.ankidroid.BackendAnkidroidService/GetColumnNamesFromQuery
get-next-result-page /anki.ankidroid.BackendAnkidroidService/GetNextResultPage
insert-for-id /anki.ankidroid.BackendAnkidroidService/InsertForId
local-minutes-west-legacy /anki.ankidroid.BackendAnkidroidService/LocalMinutesWestLegacy
run-db-command /anki.ankidroid.BackendAnkidroidService/RunDbCommand
run-db-command-for-row-count /anki.ankidroid.BackendAnkidroidService/RunDbCommandForRowCount
run-db-command-proto /anki.ankidroid.BackendAnkidroidService/RunDbCommandProto
sched-timing-today-legacy /anki.ankidroid.BackendAnkidroidService/SchedTimingTodayLegacy
set-page-size /anki.ankidroid.BackendAnkidroidService/SetPageSize
Flags:
-h, --help help for backend-ankidroid
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-ankidroid [command] --help" for more information about a command.
anki_as_code api backend-ankidroid debug-produce-error
/anki.ankidroid.BackendAnkidroidService/DebugProduceError
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api backend-ankidroid debug-produce-error [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for debug-produce-error
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid flush-all-queries
/anki.ankidroid.BackendAnkidroidService/FlushAllQueries
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-ankidroid flush-all-queries [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for flush-all-queries
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid flush-query
/anki.ankidroid.BackendAnkidroidService/FlushQuery
Request: anki.generic.Int32
Response: anki.generic.Empty
Request fields:
val: optional sint32
Usage:
anki_as_code api backend-ankidroid flush-query [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for flush-query
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid get-active-sequence-numbers
/anki.ankidroid.BackendAnkidroidService/GetActiveSequenceNumbers
Request: anki.generic.Empty
Response: anki.ankidroid.GetActiveSequenceNumbersResponse
Usage:
anki_as_code api backend-ankidroid get-active-sequence-numbers [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-active-sequence-numbers
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid get-column-names-from-query
/anki.ankidroid.BackendAnkidroidService/GetColumnNamesFromQuery
Request: anki.generic.String
Response: anki.generic.StringList
Request fields:
val: optional string
Usage:
anki_as_code api backend-ankidroid get-column-names-from-query [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-column-names-from-query
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid get-next-result-page
/anki.ankidroid.BackendAnkidroidService/GetNextResultPage
Request: anki.ankidroid.GetNextResultPageRequest
Response: anki.ankidroid.DbResponse
Request fields:
sequence: optional int32
index: optional int64
Usage:
anki_as_code api backend-ankidroid get-next-result-page [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-next-result-page
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid insert-for-id
/anki.ankidroid.BackendAnkidroidService/InsertForId
Request: anki.generic.Json
Response: anki.generic.Int64
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-ankidroid insert-for-id [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for insert-for-id
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid local-minutes-west-legacy
/anki.ankidroid.BackendAnkidroidService/LocalMinutesWestLegacy
Request: anki.generic.Int64
Response: anki.generic.Int32
Request fields:
val: optional int64
Usage:
anki_as_code api backend-ankidroid local-minutes-west-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for local-minutes-west-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid run-db-command
/anki.ankidroid.BackendAnkidroidService/RunDbCommand
Request: anki.generic.Json
Response: anki.generic.Json
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-ankidroid run-db-command [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for run-db-command
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid run-db-command-for-row-count
/anki.ankidroid.BackendAnkidroidService/RunDbCommandForRowCount
Request: anki.generic.Json
Response: anki.generic.Int64
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-ankidroid run-db-command-for-row-count [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for run-db-command-for-row-count
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid run-db-command-proto
/anki.ankidroid.BackendAnkidroidService/RunDbCommandProto
Request: anki.generic.Json
Response: anki.ankidroid.DbResponse
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-ankidroid run-db-command-proto [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for run-db-command-proto
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid sched-timing-today-legacy
/anki.ankidroid.BackendAnkidroidService/SchedTimingTodayLegacy
Request: anki.ankidroid.SchedTimingTodayLegacyRequest
Response: anki.scheduler.SchedTimingTodayResponse
Request fields:
created_secs: optional int64
created_mins_west: optional sint32
now_secs: optional int64
now_mins_west: optional sint32
rollover_hour: optional sint32
Usage:
anki_as_code api backend-ankidroid sched-timing-today-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sched-timing-today-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankidroid set-page-size
/anki.ankidroid.BackendAnkidroidService/SetPageSize
Request: anki.generic.Int64
Response: anki.generic.Empty
Request fields:
val: optional int64
Usage:
anki_as_code api backend-ankidroid set-page-size [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-page-size
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankiweb
anki.ankiweb.BackendAnkiwebService
Usage:
anki_as_code api backend-ankiweb [command]
Available Commands:
check-for-update /anki.ankiweb.BackendAnkiwebService/CheckForUpdate
get-addon-info /anki.ankiweb.BackendAnkiwebService/GetAddonInfo
Flags:
-h, --help help for backend-ankiweb
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-ankiweb [command] --help" for more information about a command.
anki_as_code api backend-ankiweb check-for-update
/anki.ankiweb.BackendAnkiwebService/CheckForUpdate
Request: anki.ankiweb.CheckForUpdateRequest
Response: anki.ankiweb.CheckForUpdateResponse
Request fields:
version: optional uint32
buildhash: optional string
os: optional string
install_id: optional int64
last_message_id: optional uint32
Usage:
anki_as_code api backend-ankiweb check-for-update [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for check-for-update
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-ankiweb get-addon-info
/anki.ankiweb.BackendAnkiwebService/GetAddonInfo
Request: anki.ankiweb.GetAddonInfoRequest
Response: anki.ankiweb.GetAddonInfoResponse
Request fields:
client_version: optional uint32
addon_ids: repeated uint32
Usage:
anki_as_code api backend-ankiweb get-addon-info [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-addon-info
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering
anki.card_rendering.BackendCardRenderingService
Usage:
anki_as_code api backend-card-rendering [command]
Available Commands:
all-tts-voices /anki.card_rendering.BackendCardRenderingService/AllTtsVoices
compare-answer /anki.card_rendering.BackendCardRenderingService/CompareAnswer
decode-iri-paths /anki.card_rendering.BackendCardRenderingService/DecodeIriPaths
encode-iri-paths /anki.card_rendering.BackendCardRenderingService/EncodeIriPaths
extract-av-tags /anki.card_rendering.BackendCardRenderingService/ExtractAvTags
extract-cloze-for-typing /anki.card_rendering.BackendCardRenderingService/ExtractClozeForTyping
extract-latex /anki.card_rendering.BackendCardRenderingService/ExtractLatex
get-empty-cards /anki.card_rendering.BackendCardRenderingService/GetEmptyCards
html-to-text-line /anki.card_rendering.BackendCardRenderingService/HtmlToTextLine
render-existing-card /anki.card_rendering.BackendCardRenderingService/RenderExistingCard
render-markdown /anki.card_rendering.BackendCardRenderingService/RenderMarkdown
render-uncommitted-card /anki.card_rendering.BackendCardRenderingService/RenderUncommittedCard
render-uncommitted-card-legacy /anki.card_rendering.BackendCardRenderingService/RenderUncommittedCardLegacy
strip-av-tags /anki.card_rendering.BackendCardRenderingService/StripAvTags
strip-html /anki.card_rendering.BackendCardRenderingService/StripHtml
write-tts-stream /anki.card_rendering.BackendCardRenderingService/WriteTtsStream
Flags:
-h, --help help for backend-card-rendering
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-card-rendering [command] --help" for more information about a command.
anki_as_code api backend-card-rendering all-tts-voices
/anki.card_rendering.BackendCardRenderingService/AllTtsVoices
Request: anki.card_rendering.AllTtsVoicesRequest
Response: anki.card_rendering.AllTtsVoicesResponse
Request fields:
validate: optional bool
Usage:
anki_as_code api backend-card-rendering all-tts-voices [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-tts-voices
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering compare-answer
/anki.card_rendering.BackendCardRenderingService/CompareAnswer
Request: anki.card_rendering.CompareAnswerRequest
Response: anki.generic.String
Request fields:
expected: optional string
provided: optional string
combining: optional bool
Usage:
anki_as_code api backend-card-rendering compare-answer [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compare-answer
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering decode-iri-paths
/anki.card_rendering.BackendCardRenderingService/DecodeIriPaths
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api backend-card-rendering decode-iri-paths [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for decode-iri-paths
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering encode-iri-paths
/anki.card_rendering.BackendCardRenderingService/EncodeIriPaths
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api backend-card-rendering encode-iri-paths [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for encode-iri-paths
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.BackendCardRenderingService/ExtractAvTags
Request: anki.card_rendering.ExtractAvTagsRequest
Response: anki.card_rendering.ExtractAvTagsResponse
Request fields:
text: optional string
question_side: optional bool
Usage:
anki_as_code api backend-card-rendering extract-av-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-av-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.BackendCardRenderingService/ExtractClozeForTyping
Request: anki.card_rendering.ExtractClozeForTypingRequest
Response: anki.generic.String
Request fields:
text: optional string
ordinal: optional uint32
Usage:
anki_as_code api backend-card-rendering extract-cloze-for-typing [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-cloze-for-typing
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.BackendCardRenderingService/ExtractLatex
Request: anki.card_rendering.ExtractLatexRequest
Response: anki.card_rendering.ExtractLatexResponse
Request fields:
text: optional string
svg: optional bool
expand_clozes: optional bool
Usage:
anki_as_code api backend-card-rendering extract-latex [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-latex
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering get-empty-cards
/anki.card_rendering.BackendCardRenderingService/GetEmptyCards
Request: anki.generic.Empty
Response: anki.card_rendering.EmptyCardsReport
Usage:
anki_as_code api backend-card-rendering get-empty-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-empty-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering html-to-text-line
/anki.card_rendering.BackendCardRenderingService/HtmlToTextLine
Request: anki.card_rendering.HtmlToTextLineRequest
Response: anki.generic.String
Request fields:
text: optional string
preserve_media_filenames: optional bool
Usage:
anki_as_code api backend-card-rendering html-to-text-line [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for html-to-text-line
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering render-existing-card
/anki.card_rendering.BackendCardRenderingService/RenderExistingCard
Request: anki.card_rendering.RenderExistingCardRequest
Response: anki.card_rendering.RenderCardResponse
Request fields:
card_id: optional int64
browser: optional bool
partial_render: optional bool
Usage:
anki_as_code api backend-card-rendering render-existing-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-existing-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering render-markdown
/anki.card_rendering.BackendCardRenderingService/RenderMarkdown
Request: anki.card_rendering.RenderMarkdownRequest
Response: anki.generic.String
Request fields:
markdown: optional string
sanitize: optional bool
Usage:
anki_as_code api backend-card-rendering render-markdown [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-markdown
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering render-uncommitted-card
/anki.card_rendering.BackendCardRenderingService/RenderUncommittedCard
Request: anki.card_rendering.RenderUncommittedCardRequest
Response: anki.card_rendering.RenderCardResponse
Request fields:
note: optional anki.notes.Note
card_ord: optional uint32
template: optional anki.notetypes.Notetype.Template
fill_empty: optional bool
partial_render: optional bool
Usage:
anki_as_code api backend-card-rendering render-uncommitted-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-uncommitted-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering render-uncommitted-card-legacy
/anki.card_rendering.BackendCardRenderingService/RenderUncommittedCardLegacy
Request: anki.card_rendering.RenderUncommittedCardLegacyRequest
Response: anki.card_rendering.RenderCardResponse
Request fields:
note: optional anki.notes.Note
card_ord: optional uint32
template: optional bytes
fill_empty: optional bool
partial_render: optional bool
Usage:
anki_as_code api backend-card-rendering render-uncommitted-card-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-uncommitted-card-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.BackendCardRenderingService/StripAvTags
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api backend-card-rendering strip-av-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for strip-av-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering strip-html
/anki.card_rendering.BackendCardRenderingService/StripHtml
Request: anki.card_rendering.StripHtmlRequest
Response: anki.generic.String
Request fields:
text: optional string
mode: optional anki.card_rendering.StripHtmlRequest.Mode
Usage:
anki_as_code api backend-card-rendering strip-html [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for strip-html
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-card-rendering write-tts-stream
/anki.card_rendering.BackendCardRenderingService/WriteTtsStream
Request: anki.card_rendering.WriteTtsStreamRequest
Response: anki.generic.Empty
Request fields:
path: optional string
voice_id: optional string
speed: optional float
text: optional string
Usage:
anki_as_code api backend-card-rendering write-tts-stream [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for write-tts-stream
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-cards
anki.cards.BackendCardsService
Usage:
anki_as_code api backend-cards [command]
Available Commands:
get-card /anki.cards.BackendCardsService/GetCard
remove-cards /anki.cards.BackendCardsService/RemoveCards
set-deck /anki.cards.BackendCardsService/SetDeck
set-flag /anki.cards.BackendCardsService/SetFlag
update-cards /anki.cards.BackendCardsService/UpdateCards
Flags:
-h, --help help for backend-cards
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-cards [command] --help" for more information about a command.
anki_as_code api backend-cards get-card
/anki.cards.BackendCardsService/GetCard
Request: anki.cards.CardId
Response: anki.cards.Card
Request fields:
cid: optional int64
Usage:
anki_as_code api backend-cards get-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-cards remove-cards
/anki.cards.BackendCardsService/RemoveCards
Request: anki.cards.RemoveCardsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
Usage:
anki_as_code api backend-cards remove-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-cards set-deck
/anki.cards.BackendCardsService/SetDeck
Request: anki.cards.SetDeckRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
deck_id: optional int64
Usage:
anki_as_code api backend-cards set-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-cards set-flag
/anki.cards.BackendCardsService/SetFlag
Request: anki.cards.SetFlagRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
flag: optional uint32
Usage:
anki_as_code api backend-cards set-flag [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-flag
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-cards update-cards
/anki.cards.BackendCardsService/UpdateCards
Request: anki.cards.UpdateCardsRequest
Response: anki.collection.OpChanges
Request fields:
cards: repeated anki.cards.Card
skip_undo_entry: optional bool
Usage:
anki_as_code api backend-cards update-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection
anki.collection.BackendCollectionService
Usage:
anki_as_code api backend-collection [command]
Available Commands:
add-custom-undo-entry /anki.collection.BackendCollectionService/AddCustomUndoEntry
await-backup-completion /anki.collection.BackendCollectionService/AwaitBackupCompletion
check-database /anki.collection.BackendCollectionService/CheckDatabase
close-collection /anki.collection.BackendCollectionService/CloseCollection
create-backup /anki.collection.BackendCollectionService/CreateBackup
get-custom-colours /anki.collection.BackendCollectionService/GetCustomColours
get-undo-status /anki.collection.BackendCollectionService/GetUndoStatus
latest-progress /anki.collection.BackendCollectionService/LatestProgress
merge-undo-entries /anki.collection.BackendCollectionService/MergeUndoEntries
open-collection /anki.collection.BackendCollectionService/OpenCollection
redo /anki.collection.BackendCollectionService/Redo
set-load-balancer-enabled /anki.collection.BackendCollectionService/SetLoadBalancerEnabled
set-wants-abort /anki.collection.BackendCollectionService/SetWantsAbort
undo /anki.collection.BackendCollectionService/Undo
Flags:
-h, --help help for backend-collection
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-collection [command] --help" for more information about a command.
anki_as_code api backend-collection add-custom-undo-entry
/anki.collection.BackendCollectionService/AddCustomUndoEntry
Request: anki.generic.String
Response: anki.generic.UInt32
Request fields:
val: optional string
Usage:
anki_as_code api backend-collection add-custom-undo-entry [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-custom-undo-entry
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection await-backup-completion
/anki.collection.BackendCollectionService/AwaitBackupCompletion
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-collection await-backup-completion [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for await-backup-completion
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection check-database
/anki.collection.BackendCollectionService/CheckDatabase
Request: anki.generic.Empty
Response: anki.collection.CheckDatabaseResponse
Usage:
anki_as_code api backend-collection check-database [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for check-database
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection close-collection
/anki.collection.BackendCollectionService/CloseCollection
Request: anki.collection.CloseCollectionRequest
Response: anki.generic.Empty
Request fields:
downgrade_to_schema11: optional bool
Usage:
anki_as_code api backend-collection close-collection [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for close-collection
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection create-backup
/anki.collection.BackendCollectionService/CreateBackup
Request: anki.collection.CreateBackupRequest
Response: anki.generic.Bool
Request fields:
backup_folder: optional string
force: optional bool
wait_for_completion: optional bool
Usage:
anki_as_code api backend-collection create-backup [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for create-backup
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection get-custom-colours
/anki.collection.BackendCollectionService/GetCustomColours
Request: anki.generic.Empty
Response: anki.collection.GetCustomColoursResponse
Usage:
anki_as_code api backend-collection get-custom-colours [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-custom-colours
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection get-undo-status
/anki.collection.BackendCollectionService/GetUndoStatus
Request: anki.generic.Empty
Response: anki.collection.UndoStatus
Usage:
anki_as_code api backend-collection get-undo-status [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-undo-status
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection latest-progress
/anki.collection.BackendCollectionService/LatestProgress
Request: anki.generic.Empty
Response: anki.collection.Progress
Usage:
anki_as_code api backend-collection latest-progress [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for latest-progress
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection merge-undo-entries
/anki.collection.BackendCollectionService/MergeUndoEntries
Request: anki.generic.UInt32
Response: anki.collection.OpChanges
Request fields:
val: optional uint32
Usage:
anki_as_code api backend-collection merge-undo-entries [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for merge-undo-entries
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection open-collection
/anki.collection.BackendCollectionService/OpenCollection
Request: anki.collection.OpenCollectionRequest
Response: anki.generic.Empty
Request fields:
collection_path: optional string
media_folder_path: optional string
media_db_path: optional string
Usage:
anki_as_code api backend-collection open-collection [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-collection
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection redo
/anki.collection.BackendCollectionService/Redo
Request: anki.generic.Empty
Response: anki.collection.OpChangesAfterUndo
Usage:
anki_as_code api backend-collection redo [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for redo
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection set-load-balancer-enabled
/anki.collection.BackendCollectionService/SetLoadBalancerEnabled
Request: anki.generic.Bool
Response: anki.collection.OpChanges
Request fields:
val: optional bool
Usage:
anki_as_code api backend-collection set-load-balancer-enabled [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-load-balancer-enabled
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection set-wants-abort
/anki.collection.BackendCollectionService/SetWantsAbort
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-collection set-wants-abort [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-wants-abort
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-collection undo
/anki.collection.BackendCollectionService/Undo
Request: anki.generic.Empty
Response: anki.collection.OpChangesAfterUndo
Usage:
anki_as_code api backend-collection undo [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for undo
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config
anki.config.BackendConfigService
Usage:
anki_as_code api backend-config [command]
Available Commands:
get-all-config /anki.config.BackendConfigService/GetAllConfig
get-config-bool /anki.config.BackendConfigService/GetConfigBool
get-config-json /anki.config.BackendConfigService/GetConfigJson
get-config-string /anki.config.BackendConfigService/GetConfigString
get-preferences /anki.config.BackendConfigService/GetPreferences
remove-config /anki.config.BackendConfigService/RemoveConfig
set-config-bool /anki.config.BackendConfigService/SetConfigBool
set-config-json /anki.config.BackendConfigService/SetConfigJson
set-config-json-no-undo /anki.config.BackendConfigService/SetConfigJsonNoUndo
set-config-string /anki.config.BackendConfigService/SetConfigString
set-preferences /anki.config.BackendConfigService/SetPreferences
Flags:
-h, --help help for backend-config
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-config [command] --help" for more information about a command.
anki_as_code api backend-config get-all-config
/anki.config.BackendConfigService/GetAllConfig
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api backend-config get-all-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-all-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config get-config-bool
/anki.config.BackendConfigService/GetConfigBool
Request: anki.config.GetConfigBoolRequest
Response: anki.generic.Bool
Request fields:
key: optional anki.config.ConfigKey.Bool
Usage:
anki_as_code api backend-config get-config-bool [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-config-bool
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config get-config-json
/anki.config.BackendConfigService/GetConfigJson
Request: anki.generic.String
Response: anki.generic.Json
Request fields:
val: optional string
Usage:
anki_as_code api backend-config get-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config get-config-string
/anki.config.BackendConfigService/GetConfigString
Request: anki.config.GetConfigStringRequest
Response: anki.generic.String
Request fields:
key: optional anki.config.ConfigKey.String
Usage:
anki_as_code api backend-config get-config-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-config-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config get-preferences
/anki.config.BackendConfigService/GetPreferences
Request: anki.generic.Empty
Response: anki.config.Preferences
Usage:
anki_as_code api backend-config get-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config remove-config
/anki.config.BackendConfigService/RemoveConfig
Request: anki.generic.String
Response: anki.collection.OpChanges
Request fields:
val: optional string
Usage:
anki_as_code api backend-config remove-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config set-config-bool
/anki.config.BackendConfigService/SetConfigBool
Request: anki.config.SetConfigBoolRequest
Response: anki.collection.OpChanges
Request fields:
key: optional anki.config.ConfigKey.Bool
value: optional bool
undoable: optional bool
Usage:
anki_as_code api backend-config set-config-bool [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-bool
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config set-config-json
/anki.config.BackendConfigService/SetConfigJson
Request: anki.config.SetConfigJsonRequest
Response: anki.collection.OpChanges
Request fields:
key: optional string
value_json: optional bytes
undoable: optional bool
Usage:
anki_as_code api backend-config set-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config set-config-json-no-undo
/anki.config.BackendConfigService/SetConfigJsonNoUndo
Request: anki.config.SetConfigJsonRequest
Response: anki.generic.Empty
Request fields:
key: optional string
value_json: optional bytes
undoable: optional bool
Usage:
anki_as_code api backend-config set-config-json-no-undo [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-json-no-undo
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config set-config-string
/anki.config.BackendConfigService/SetConfigString
Request: anki.config.SetConfigStringRequest
Response: anki.collection.OpChanges
Request fields:
key: optional anki.config.ConfigKey.String
value: optional string
undoable: optional bool
Usage:
anki_as_code api backend-config set-config-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-config set-preferences
/anki.config.BackendConfigService/SetPreferences
Request: anki.config.Preferences
Response: anki.collection.OpChanges
Request fields:
scheduling: optional anki.config.Preferences.Scheduling
reviewing: optional anki.config.Preferences.Reviewing
editing: optional anki.config.Preferences.Editing
backups: optional anki.config.Preferences.BackupLimits
Usage:
anki_as_code api backend-config set-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config
anki.deck_config.BackendDeckConfigService
Usage:
anki_as_code api backend-deck-config [command]
Available Commands:
add-or-update-deck-config-legacy /anki.deck_config.BackendDeckConfigService/AddOrUpdateDeckConfigLegacy
all-deck-config-legacy /anki.deck_config.BackendDeckConfigService/AllDeckConfigLegacy
get-deck-config /anki.deck_config.BackendDeckConfigService/GetDeckConfig
get-deck-config-legacy /anki.deck_config.BackendDeckConfigService/GetDeckConfigLegacy
get-deck-configs-for-update /anki.deck_config.BackendDeckConfigService/GetDeckConfigsForUpdate
get-ignored-before-count /anki.deck_config.BackendDeckConfigService/GetIgnoredBeforeCount
get-retention-workload /anki.deck_config.BackendDeckConfigService/GetRetentionWorkload
new-deck-config-legacy /anki.deck_config.BackendDeckConfigService/NewDeckConfigLegacy
remove-deck-config /anki.deck_config.BackendDeckConfigService/RemoveDeckConfig
update-deck-configs /anki.deck_config.BackendDeckConfigService/UpdateDeckConfigs
Flags:
-h, --help help for backend-deck-config
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-deck-config [command] --help" for more information about a command.
anki_as_code api backend-deck-config add-or-update-deck-config-legacy
/anki.deck_config.BackendDeckConfigService/AddOrUpdateDeckConfigLegacy
Request: anki.generic.Json
Response: anki.deck_config.DeckConfigId
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-deck-config add-or-update-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config all-deck-config-legacy
/anki.deck_config.BackendDeckConfigService/AllDeckConfigLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api backend-deck-config all-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config get-deck-config
/anki.deck_config.BackendDeckConfigService/GetDeckConfig
Request: anki.deck_config.DeckConfigId
Response: anki.deck_config.DeckConfig
Request fields:
dcid: optional int64
Usage:
anki_as_code api backend-deck-config get-deck-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config get-deck-config-legacy
/anki.deck_config.BackendDeckConfigService/GetDeckConfigLegacy
Request: anki.deck_config.DeckConfigId
Response: anki.generic.Json
Request fields:
dcid: optional int64
Usage:
anki_as_code api backend-deck-config get-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config get-deck-configs-for-update
/anki.deck_config.BackendDeckConfigService/GetDeckConfigsForUpdate
Request: anki.decks.DeckId
Response: anki.deck_config.DeckConfigsForUpdate
Request fields:
did: optional int64
Usage:
anki_as_code api backend-deck-config get-deck-configs-for-update [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-configs-for-update
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config get-ignored-before-count
/anki.deck_config.BackendDeckConfigService/GetIgnoredBeforeCount
Request: anki.deck_config.GetIgnoredBeforeCountRequest
Response: anki.deck_config.GetIgnoredBeforeCountResponse
Request fields:
ignore_revlogs_before_date: optional string
search: optional string
Usage:
anki_as_code api backend-deck-config get-ignored-before-count [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-ignored-before-count
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config get-retention-workload
/anki.deck_config.BackendDeckConfigService/GetRetentionWorkload
Request: anki.deck_config.GetRetentionWorkloadRequest
Response: anki.deck_config.GetRetentionWorkloadResponse
Request fields:
w: repeated float
search: optional string
Usage:
anki_as_code api backend-deck-config get-retention-workload [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-retention-workload
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config new-deck-config-legacy
/anki.deck_config.BackendDeckConfigService/NewDeckConfigLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api backend-deck-config new-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config remove-deck-config
/anki.deck_config.BackendDeckConfigService/RemoveDeckConfig
Request: anki.deck_config.DeckConfigId
Response: anki.generic.Empty
Request fields:
dcid: optional int64
Usage:
anki_as_code api backend-deck-config remove-deck-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-deck-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-deck-config update-deck-configs
/anki.deck_config.BackendDeckConfigService/UpdateDeckConfigs
Request: anki.deck_config.UpdateDeckConfigsRequest
Response: anki.collection.OpChanges
Request fields:
target_deck_id: optional int64
configs: repeated anki.deck_config.DeckConfig
removed_config_ids: repeated int64
mode: optional anki.deck_config.UpdateDeckConfigsMode
card_state_customizer: optional string
limits: optional anki.deck_config.DeckConfigsForUpdate.CurrentDeck.Limits
new_cards_ignore_review_limit: optional bool
fsrs: optional bool
apply_all_parent_limits: optional bool
fsrs_reschedule: optional bool
fsrs_health_check: optional bool
Usage:
anki_as_code api backend-deck-config update-deck-configs [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-deck-configs
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks
anki.decks.BackendDecksService
Usage:
anki_as_code api backend-decks [command]
Available Commands:
add-deck /anki.decks.BackendDecksService/AddDeck
add-deck-legacy /anki.decks.BackendDecksService/AddDeckLegacy
add-or-update-deck-legacy /anki.decks.BackendDecksService/AddOrUpdateDeckLegacy
add-or-update-filtered-deck /anki.decks.BackendDecksService/AddOrUpdateFilteredDeck
deck-tree /anki.decks.BackendDecksService/DeckTree
deck-tree-legacy /anki.decks.BackendDecksService/DeckTreeLegacy
filtered-deck-order-labels /anki.decks.BackendDecksService/FilteredDeckOrderLabels
get-all-decks-legacy /anki.decks.BackendDecksService/GetAllDecksLegacy
get-current-deck /anki.decks.BackendDecksService/GetCurrentDeck
get-deck /anki.decks.BackendDecksService/GetDeck
get-deck-and-child-names /anki.decks.BackendDecksService/GetDeckAndChildNames
get-deck-id-by-name /anki.decks.BackendDecksService/GetDeckIdByName
get-deck-legacy /anki.decks.BackendDecksService/GetDeckLegacy
get-deck-names /anki.decks.BackendDecksService/GetDeckNames
get-or-create-filtered-deck /anki.decks.BackendDecksService/GetOrCreateFilteredDeck
new-deck /anki.decks.BackendDecksService/NewDeck
new-deck-legacy /anki.decks.BackendDecksService/NewDeckLegacy
remove-decks /anki.decks.BackendDecksService/RemoveDecks
rename-deck /anki.decks.BackendDecksService/RenameDeck
reparent-decks /anki.decks.BackendDecksService/ReparentDecks
set-current-deck /anki.decks.BackendDecksService/SetCurrentDeck
set-deck-collapsed /anki.decks.BackendDecksService/SetDeckCollapsed
update-deck /anki.decks.BackendDecksService/UpdateDeck
update-deck-legacy /anki.decks.BackendDecksService/UpdateDeckLegacy
Flags:
-h, --help help for backend-decks
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-decks [command] --help" for more information about a command.
anki_as_code api backend-decks add-deck
/anki.decks.BackendDecksService/AddDeck
Request: anki.decks.Deck
Response: anki.collection.OpChangesWithId
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional int32
common: optional anki.decks.Deck.Common
normal: optional anki.decks.Deck.Normal
filtered: optional anki.decks.Deck.Filtered
Usage:
anki_as_code api backend-decks add-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks add-deck-legacy
/anki.decks.BackendDecksService/AddDeckLegacy
Request: anki.generic.Json
Response: anki.collection.OpChangesWithId
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-decks add-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks add-or-update-deck-legacy
/anki.decks.BackendDecksService/AddOrUpdateDeckLegacy
Request: anki.decks.AddOrUpdateDeckLegacyRequest
Response: anki.decks.DeckId
Request fields:
deck: optional bytes
preserve_usn_and_mtime: optional bool
Usage:
anki_as_code api backend-decks add-or-update-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks add-or-update-filtered-deck
/anki.decks.BackendDecksService/AddOrUpdateFilteredDeck
Request: anki.decks.FilteredDeckForUpdate
Response: anki.collection.OpChangesWithId
Request fields:
id: optional int64
name: optional string
config: optional anki.decks.Deck.Filtered
allow_empty: optional bool
Usage:
anki_as_code api backend-decks add-or-update-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks deck-tree
/anki.decks.BackendDecksService/DeckTree
Request: anki.decks.DeckTreeRequest
Response: anki.decks.DeckTreeNode
Request fields:
now: optional int64
Usage:
anki_as_code api backend-decks deck-tree [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-tree
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks deck-tree-legacy
/anki.decks.BackendDecksService/DeckTreeLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api backend-decks deck-tree-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-tree-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks filtered-deck-order-labels
/anki.decks.BackendDecksService/FilteredDeckOrderLabels
Request: anki.generic.Empty
Response: anki.generic.StringList
Usage:
anki_as_code api backend-decks filtered-deck-order-labels [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for filtered-deck-order-labels
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-all-decks-legacy
/anki.decks.BackendDecksService/GetAllDecksLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api backend-decks get-all-decks-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-all-decks-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-current-deck
/anki.decks.BackendDecksService/GetCurrentDeck
Request: anki.generic.Empty
Response: anki.decks.Deck
Usage:
anki_as_code api backend-decks get-current-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-current-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-deck
/anki.decks.BackendDecksService/GetDeck
Request: anki.decks.DeckId
Response: anki.decks.Deck
Request fields:
did: optional int64
Usage:
anki_as_code api backend-decks get-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-deck-and-child-names
/anki.decks.BackendDecksService/GetDeckAndChildNames
Request: anki.decks.DeckId
Response: anki.decks.DeckNames
Request fields:
did: optional int64
Usage:
anki_as_code api backend-decks get-deck-and-child-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-and-child-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-deck-id-by-name
/anki.decks.BackendDecksService/GetDeckIdByName
Request: anki.generic.String
Response: anki.decks.DeckId
Request fields:
val: optional string
Usage:
anki_as_code api backend-decks get-deck-id-by-name [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-id-by-name
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-deck-legacy
/anki.decks.BackendDecksService/GetDeckLegacy
Request: anki.decks.DeckId
Response: anki.generic.Json
Request fields:
did: optional int64
Usage:
anki_as_code api backend-decks get-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-deck-names
/anki.decks.BackendDecksService/GetDeckNames
Request: anki.decks.GetDeckNamesRequest
Response: anki.decks.DeckNames
Request fields:
skip_empty_default: optional bool
include_filtered: optional bool
Usage:
anki_as_code api backend-decks get-deck-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks get-or-create-filtered-deck
/anki.decks.BackendDecksService/GetOrCreateFilteredDeck
Request: anki.decks.DeckId
Response: anki.decks.FilteredDeckForUpdate
Request fields:
did: optional int64
Usage:
anki_as_code api backend-decks get-or-create-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-or-create-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks new-deck
/anki.decks.BackendDecksService/NewDeck
Request: anki.generic.Empty
Response: anki.decks.Deck
Usage:
anki_as_code api backend-decks new-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks new-deck-legacy
/anki.decks.BackendDecksService/NewDeckLegacy
Request: anki.generic.Bool
Response: anki.generic.Json
Request fields:
val: optional bool
Usage:
anki_as_code api backend-decks new-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks remove-decks
/anki.decks.BackendDecksService/RemoveDecks
Request: anki.decks.DeckIds
Response: anki.collection.OpChangesWithCount
Request fields:
dids: repeated int64
Usage:
anki_as_code api backend-decks remove-decks [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-decks
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks rename-deck
/anki.decks.BackendDecksService/RenameDeck
Request: anki.decks.RenameDeckRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
new_name: optional string
Usage:
anki_as_code api backend-decks rename-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for rename-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks reparent-decks
/anki.decks.BackendDecksService/ReparentDecks
Request: anki.decks.ReparentDecksRequest
Response: anki.collection.OpChangesWithCount
Request fields:
deck_ids: repeated int64
new_parent: optional int64
Usage:
anki_as_code api backend-decks reparent-decks [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for reparent-decks
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks set-current-deck
/anki.decks.BackendDecksService/SetCurrentDeck
Request: anki.decks.DeckId
Response: anki.collection.OpChanges
Request fields:
did: optional int64
Usage:
anki_as_code api backend-decks set-current-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-current-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks set-deck-collapsed
/anki.decks.BackendDecksService/SetDeckCollapsed
Request: anki.decks.SetDeckCollapsedRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
collapsed: optional bool
scope: optional anki.decks.SetDeckCollapsedRequest.Scope
Usage:
anki_as_code api backend-decks set-deck-collapsed [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-deck-collapsed
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks update-deck
/anki.decks.BackendDecksService/UpdateDeck
Request: anki.decks.Deck
Response: anki.collection.OpChanges
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional int32
common: optional anki.decks.Deck.Common
normal: optional anki.decks.Deck.Normal
filtered: optional anki.decks.Deck.Filtered
Usage:
anki_as_code api backend-decks update-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-decks update-deck-legacy
/anki.decks.BackendDecksService/UpdateDeckLegacy
Request: anki.generic.Json
Response: anki.collection.OpChanges
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-decks update-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend
anki.frontend.BackendFrontendService
Usage:
anki_as_code api backend-frontend [command]
Available Commands:
ask-user /anki.frontend.BackendFrontendService/AskUser
close-add-cards /anki.frontend.BackendFrontendService/CloseAddCards
close-edit-current /anki.frontend.BackendFrontendService/CloseEditCurrent
convert-pasted-image /anki.frontend.BackendFrontendService/ConvertPastedImage
deck-options-ready /anki.frontend.BackendFrontendService/deckOptionsReady
deck-options-require-close /anki.frontend.BackendFrontendService/deckOptionsRequireClose
get-meta-json /anki.frontend.BackendFrontendService/GetMetaJson
get-profile-config-json /anki.frontend.BackendFrontendService/GetProfileConfigJson
get-scheduling-states-with-context /anki.frontend.BackendFrontendService/GetSchedulingStatesWithContext
import-dialog-require-close /anki.frontend.BackendFrontendService/ImportDialogRequireClose
import-done /anki.frontend.BackendFrontendService/ImportDone
open-cards-dialog /anki.frontend.BackendFrontendService/OpenCardsDialog
open-fields-dialog /anki.frontend.BackendFrontendService/OpenFieldsDialog
open-file-picker /anki.frontend.BackendFrontendService/OpenFilePicker
open-link /anki.frontend.BackendFrontendService/OpenLink
open-media /anki.frontend.BackendFrontendService/OpenMedia
play-file /anki.frontend.BackendFrontendService/PlayFile
read-clipboard /anki.frontend.BackendFrontendService/ReadClipboard
record-audio /anki.frontend.BackendFrontendService/RecordAudio
save-custom-colours /anki.frontend.BackendFrontendService/SaveCustomColours
search-in-browser /anki.frontend.BackendFrontendService/SearchInBrowser
set-meta-json /anki.frontend.BackendFrontendService/SetMetaJson
set-profile-config-json /anki.frontend.BackendFrontendService/SetProfileConfigJson
set-scheduling-states /anki.frontend.BackendFrontendService/SetSchedulingStates
show-in-media-folder /anki.frontend.BackendFrontendService/ShowInMediaFolder
show-message-box /anki.frontend.BackendFrontendService/ShowMessageBox
write-clipboard /anki.frontend.BackendFrontendService/WriteClipboard
Flags:
-h, --help help for backend-frontend
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-frontend [command] --help" for more information about a command.
anki_as_code api backend-frontend ask-user
/anki.frontend.BackendFrontendService/AskUser
Request: anki.frontend.AskUserRequest
Response: anki.generic.Bool
Request fields:
text: optional string
help: optional anki.frontend.Help
title: optional string
default_no: optional bool
Usage:
anki_as_code api backend-frontend ask-user [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for ask-user
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend close-add-cards
/anki.frontend.BackendFrontendService/CloseAddCards
Request: anki.generic.Bool
Response: anki.generic.Empty
Request fields:
val: optional bool
Usage:
anki_as_code api backend-frontend close-add-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for close-add-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend close-edit-current
/anki.frontend.BackendFrontendService/CloseEditCurrent
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend close-edit-current [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for close-edit-current
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend convert-pasted-image
/anki.frontend.BackendFrontendService/ConvertPastedImage
Request: anki.frontend.ConvertPastedImageRequest
Response: anki.frontend.ConvertPastedImageResponse
Request fields:
data: optional bytes
ext: optional string
Usage:
anki_as_code api backend-frontend convert-pasted-image [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for convert-pasted-image
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend deck-options-ready
/anki.frontend.BackendFrontendService/deckOptionsReady
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend deck-options-ready [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-options-ready
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend deck-options-require-close
/anki.frontend.BackendFrontendService/deckOptionsRequireClose
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend deck-options-require-close [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-options-require-close
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.BackendFrontendService/GetMetaJson
Request: anki.generic.String
Response: anki.generic.Json
Request fields:
val: optional string
Usage:
anki_as_code api backend-frontend get-meta-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-meta-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend get-profile-config-json
/anki.frontend.BackendFrontendService/GetProfileConfigJson
Request: anki.generic.String
Response: anki.generic.Json
Request fields:
val: optional string
Usage:
anki_as_code api backend-frontend get-profile-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-profile-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend get-scheduling-states-with-context
/anki.frontend.BackendFrontendService/GetSchedulingStatesWithContext
Request: anki.generic.Empty
Response: anki.frontend.SchedulingStatesWithContext
Usage:
anki_as_code api backend-frontend get-scheduling-states-with-context [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-scheduling-states-with-context
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend import-dialog-require-close
/anki.frontend.BackendFrontendService/ImportDialogRequireClose
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend import-dialog-require-close [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-dialog-require-close
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend import-done
/anki.frontend.BackendFrontendService/ImportDone
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend import-done [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-done
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend open-cards-dialog
/anki.frontend.BackendFrontendService/OpenCardsDialog
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend open-cards-dialog [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-cards-dialog
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend open-fields-dialog
/anki.frontend.BackendFrontendService/OpenFieldsDialog
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend open-fields-dialog [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-fields-dialog
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend open-file-picker
/anki.frontend.BackendFrontendService/OpenFilePicker
Request: anki.frontend.openFilePickerRequest
Response: anki.generic.String
Request fields:
title: optional string
key: optional string
filter_description: optional string
extensions: repeated string
Usage:
anki_as_code api backend-frontend open-file-picker [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-file-picker
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend open-link
/anki.frontend.BackendFrontendService/OpenLink
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api backend-frontend open-link [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-link
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.BackendFrontendService/OpenMedia
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api backend-frontend open-media [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-media
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend play-file
/anki.frontend.BackendFrontendService/PlayFile
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api backend-frontend play-file [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for play-file
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend read-clipboard
/anki.frontend.BackendFrontendService/ReadClipboard
Request: anki.frontend.ReadClipboardRequest
Response: anki.frontend.ReadClipboardResponse
Request fields:
types: repeated string
Usage:
anki_as_code api backend-frontend read-clipboard [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for read-clipboard
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend record-audio
/anki.frontend.BackendFrontendService/RecordAudio
Request: anki.generic.Empty
Response: anki.generic.String
Usage:
anki_as_code api backend-frontend record-audio [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for record-audio
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend save-custom-colours
/anki.frontend.BackendFrontendService/SaveCustomColours
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-frontend save-custom-colours [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for save-custom-colours
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend search-in-browser
/anki.frontend.BackendFrontendService/SearchInBrowser
Request: anki.search.SearchNode
Response: anki.generic.Empty
Request fields:
group: optional anki.search.SearchNode.Group
negated: optional anki.search.SearchNode
parsable_text: optional string
template: optional uint32
nid: optional int64
dupe: optional anki.search.SearchNode.Dupe
field_name: optional string
rated: optional anki.search.SearchNode.Rated
added_in_days: optional uint32
due_in_days: optional int32
flag: optional anki.search.SearchNode.Flag
card_state: optional anki.search.SearchNode.CardState
nids: optional anki.search.SearchNode.IdList
edited_in_days: optional uint32
deck: optional string
due_on_day: optional int32
tag: optional string
note: optional string
introduced_in_days: optional uint32
field: optional anki.search.SearchNode.Field
literal_text: optional string
Usage:
anki_as_code api backend-frontend search-in-browser [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for search-in-browser
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.BackendFrontendService/SetMetaJson
Request: anki.frontend.SetSettingJsonRequest
Response: anki.generic.Empty
Request fields:
key: optional string
value_json: optional bytes
Usage:
anki_as_code api backend-frontend set-meta-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-meta-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend set-profile-config-json
/anki.frontend.BackendFrontendService/SetProfileConfigJson
Request: anki.frontend.SetSettingJsonRequest
Response: anki.generic.Empty
Request fields:
key: optional string
value_json: optional bytes
Usage:
anki_as_code api backend-frontend set-profile-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-profile-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend set-scheduling-states
/anki.frontend.BackendFrontendService/SetSchedulingStates
Request: anki.frontend.SetSchedulingStatesRequest
Response: anki.generic.Empty
Request fields:
key: optional string
states: optional anki.scheduler.SchedulingStates
Usage:
anki_as_code api backend-frontend set-scheduling-states [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-scheduling-states
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.BackendFrontendService/ShowInMediaFolder
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api backend-frontend show-in-media-folder [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for show-in-media-folder
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend show-message-box
/anki.frontend.BackendFrontendService/ShowMessageBox
Request: anki.frontend.ShowMessageBoxRequest
Response: anki.generic.Empty
Request fields:
text: optional string
type: optional anki.frontend.MessageBoxType
help: optional anki.frontend.Help
title: optional string
text_format: optional string
Usage:
anki_as_code api backend-frontend show-message-box [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for show-message-box
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-frontend write-clipboard
/anki.frontend.BackendFrontendService/WriteClipboard
Request: anki.frontend.WriteClipboardRequest
Response: anki.generic.Empty
Request fields:
data: repeated anki.frontend.WriteClipboardRequest.DataEntry
Usage:
anki_as_code api backend-frontend write-clipboard [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for write-clipboard
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-github
anki.github.BackendGithubService
Usage:
anki_as_code api backend-github [command]
Available Commands:
download-release /anki.github.BackendGithubService/DownloadRelease
get-latest-release /anki.github.BackendGithubService/GetLatestRelease
Flags:
-h, --help help for backend-github
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-github [command] --help" for more information about a command.
anki_as_code api backend-github download-release
/anki.github.BackendGithubService/DownloadRelease
Request: anki.github.GithubRelease
Response: anki.generic.String
Request fields:
tag_name: optional string
filename: optional string
url: optional string
checksum: optional string
Usage:
anki_as_code api backend-github download-release [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for download-release
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-github get-latest-release
/anki.github.BackendGithubService/GetLatestRelease
Request: anki.github.LatestReleaseRequest
Response: anki.github.GithubRelease
Request fields:
include_prerelease: optional bool
Usage:
anki_as_code api backend-github get-latest-release [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-latest-release
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-i18n
anki.i18n.BackendI18nService
Usage:
anki_as_code api backend-i18n [command]
Available Commands:
format-timespan /anki.i18n.BackendI18nService/FormatTimespan
i18n-resources /anki.i18n.BackendI18nService/I18nResources
translate-string /anki.i18n.BackendI18nService/TranslateString
Flags:
-h, --help help for backend-i18n
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-i18n [command] --help" for more information about a command.
/anki.i18n.BackendI18nService/FormatTimespan
Request: anki.i18n.FormatTimespanRequest
Response: anki.generic.String
Request fields:
seconds: optional float
context: optional anki.i18n.FormatTimespanRequest.Context
Usage:
anki_as_code api backend-i18n format-timespan [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for format-timespan
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-i18n i18n-resources
/anki.i18n.BackendI18nService/I18nResources
Request: anki.i18n.I18nResourcesRequest
Response: anki.generic.Json
Request fields:
modules: repeated string
Usage:
anki_as_code api backend-i18n i18n-resources [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for i18n-resources
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-i18n translate-string
/anki.i18n.BackendI18nService/TranslateString
Request: anki.i18n.TranslateStringRequest
Response: anki.generic.String
Request fields:
module_index: optional uint32
message_index: optional uint32
args: repeated anki.i18n.TranslateStringRequest.ArgsEntry
Usage:
anki_as_code api backend-i18n translate-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for translate-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-image-occlusion
anki.image_occlusion.BackendImageOcclusionService
Usage:
anki_as_code api backend-image-occlusion [command]
Available Commands:
add-image-occlusion-note /anki.image_occlusion.BackendImageOcclusionService/AddImageOcclusionNote
add-image-occlusion-notetype /anki.image_occlusion.BackendImageOcclusionService/AddImageOcclusionNotetype
get-image-for-occlusion /anki.image_occlusion.BackendImageOcclusionService/GetImageForOcclusion
get-image-occlusion-fields /anki.image_occlusion.BackendImageOcclusionService/GetImageOcclusionFields
get-image-occlusion-note /anki.image_occlusion.BackendImageOcclusionService/GetImageOcclusionNote
update-image-occlusion-note /anki.image_occlusion.BackendImageOcclusionService/UpdateImageOcclusionNote
Flags:
-h, --help help for backend-image-occlusion
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-image-occlusion [command] --help" for more information about a command.
anki_as_code api backend-image-occlusion add-image-occlusion-note
/anki.image_occlusion.BackendImageOcclusionService/AddImageOcclusionNote
Request: anki.image_occlusion.AddImageOcclusionNoteRequest
Response: anki.collection.OpChanges
Request fields:
image_path: optional string
occlusions: optional string
header: optional string
back_extra: optional string
tags: repeated string
notetype_id: optional int64
Usage:
anki_as_code api backend-image-occlusion add-image-occlusion-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-image-occlusion-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-image-occlusion add-image-occlusion-notetype
/anki.image_occlusion.BackendImageOcclusionService/AddImageOcclusionNotetype
Request: anki.generic.Empty
Response: anki.collection.OpChanges
Usage:
anki_as_code api backend-image-occlusion add-image-occlusion-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-image-occlusion-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-image-occlusion get-image-for-occlusion
/anki.image_occlusion.BackendImageOcclusionService/GetImageForOcclusion
Request: anki.image_occlusion.GetImageForOcclusionRequest
Response: anki.image_occlusion.GetImageForOcclusionResponse
Request fields:
path: optional string
Usage:
anki_as_code api backend-image-occlusion get-image-for-occlusion [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-image-for-occlusion
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-image-occlusion get-image-occlusion-fields
/anki.image_occlusion.BackendImageOcclusionService/GetImageOcclusionFields
Request: anki.image_occlusion.GetImageOcclusionFieldsRequest
Response: anki.image_occlusion.GetImageOcclusionFieldsResponse
Request fields:
notetype_id: optional int64
Usage:
anki_as_code api backend-image-occlusion get-image-occlusion-fields [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-image-occlusion-fields
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-image-occlusion get-image-occlusion-note
/anki.image_occlusion.BackendImageOcclusionService/GetImageOcclusionNote
Request: anki.image_occlusion.GetImageOcclusionNoteRequest
Response: anki.image_occlusion.GetImageOcclusionNoteResponse
Request fields:
note_id: optional int64
Usage:
anki_as_code api backend-image-occlusion get-image-occlusion-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-image-occlusion-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-image-occlusion update-image-occlusion-note
/anki.image_occlusion.BackendImageOcclusionService/UpdateImageOcclusionNote
Request: anki.image_occlusion.UpdateImageOcclusionNoteRequest
Response: anki.collection.OpChanges
Request fields:
note_id: optional int64
occlusions: optional string
header: optional string
back_extra: optional string
tags: repeated string
Usage:
anki_as_code api backend-image-occlusion update-image-occlusion-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-image-occlusion-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export
anki.import_export.BackendImportExportService
Usage:
anki_as_code api backend-import-export [command]
Available Commands:
export-anki-package /anki.import_export.BackendImportExportService/ExportAnkiPackage
export-card-csv /anki.import_export.BackendImportExportService/ExportCardCsv
export-collection-package /anki.import_export.BackendImportExportService/ExportCollectionPackage
export-note-csv /anki.import_export.BackendImportExportService/ExportNoteCsv
get-csv-metadata /anki.import_export.BackendImportExportService/GetCsvMetadata
get-import-anki-package-presets /anki.import_export.BackendImportExportService/GetImportAnkiPackagePresets
import-anki-package /anki.import_export.BackendImportExportService/ImportAnkiPackage
import-collection-package /anki.import_export.BackendImportExportService/ImportCollectionPackage
import-csv /anki.import_export.BackendImportExportService/ImportCsv
import-json-file /anki.import_export.BackendImportExportService/ImportJsonFile
import-json-string /anki.import_export.BackendImportExportService/ImportJsonString
Flags:
-h, --help help for backend-import-export
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-import-export [command] --help" for more information about a command.
anki_as_code api backend-import-export export-anki-package
/anki.import_export.BackendImportExportService/ExportAnkiPackage
Request: anki.import_export.ExportAnkiPackageRequest
Response: anki.generic.UInt32
Request fields:
out_path: optional string
options: optional anki.import_export.ExportAnkiPackageOptions
limit: optional anki.import_export.ExportLimit
Usage:
anki_as_code api backend-import-export export-anki-package [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-anki-package
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export export-card-csv
/anki.import_export.BackendImportExportService/ExportCardCsv
Request: anki.import_export.ExportCardCsvRequest
Response: anki.generic.UInt32
Request fields:
out_path: optional string
with_html: optional bool
limit: optional anki.import_export.ExportLimit
Usage:
anki_as_code api backend-import-export export-card-csv [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-card-csv
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export export-collection-package
/anki.import_export.BackendImportExportService/ExportCollectionPackage
Request: anki.import_export.ExportCollectionPackageRequest
Response: anki.generic.Empty
Request fields:
out_path: optional string
include_media: optional bool
legacy: optional bool
Usage:
anki_as_code api backend-import-export export-collection-package [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-collection-package
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export export-note-csv
/anki.import_export.BackendImportExportService/ExportNoteCsv
Request: anki.import_export.ExportNoteCsvRequest
Response: anki.generic.UInt32
Request fields:
out_path: optional string
with_html: optional bool
with_tags: optional bool
with_deck: optional bool
with_notetype: optional bool
with_guid: optional bool
limit: optional anki.import_export.ExportLimit
Usage:
anki_as_code api backend-import-export export-note-csv [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-note-csv
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.import_export.BackendImportExportService/GetCsvMetadata
Request: anki.import_export.CsvMetadataRequest
Response: anki.import_export.CsvMetadata
Request fields:
path: optional string
delimiter: optional anki.import_export.CsvMetadata.Delimiter
notetype_id: optional int64
deck_id: optional int64
is_html: optional bool
Usage:
anki_as_code api backend-import-export get-csv-metadata [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-csv-metadata
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export get-import-anki-package-presets
/anki.import_export.BackendImportExportService/GetImportAnkiPackagePresets
Request: anki.generic.Empty
Response: anki.import_export.ImportAnkiPackageOptions
Usage:
anki_as_code api backend-import-export get-import-anki-package-presets [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-import-anki-package-presets
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export import-anki-package
/anki.import_export.BackendImportExportService/ImportAnkiPackage
Request: anki.import_export.ImportAnkiPackageRequest
Response: anki.import_export.ImportResponse
Request fields:
package_path: optional string
options: optional anki.import_export.ImportAnkiPackageOptions
Usage:
anki_as_code api backend-import-export import-anki-package [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-anki-package
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export import-collection-package
/anki.import_export.BackendImportExportService/ImportCollectionPackage
Request: anki.import_export.ImportCollectionPackageRequest
Response: anki.generic.Empty
Request fields:
col_path: optional string
backup_path: optional string
media_folder: optional string
media_db: optional string
Usage:
anki_as_code api backend-import-export import-collection-package [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-collection-package
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export import-csv
/anki.import_export.BackendImportExportService/ImportCsv
Request: anki.import_export.ImportCsvRequest
Response: anki.import_export.ImportResponse
Request fields:
path: optional string
metadata: optional anki.import_export.CsvMetadata
Usage:
anki_as_code api backend-import-export import-csv [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-csv
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export import-json-file
/anki.import_export.BackendImportExportService/ImportJsonFile
Request: anki.generic.String
Response: anki.import_export.ImportResponse
Request fields:
val: optional string
Usage:
anki_as_code api backend-import-export import-json-file [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-json-file
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-import-export import-json-string
/anki.import_export.BackendImportExportService/ImportJsonString
Request: anki.generic.String
Response: anki.import_export.ImportResponse
Request fields:
val: optional string
Usage:
anki_as_code api backend-import-export import-json-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-json-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-links
anki.links.BackendLinksService
Usage:
anki_as_code api backend-links [command]
Available Commands:
help-page-link /anki.links.BackendLinksService/HelpPageLink
Flags:
-h, --help help for backend-links
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-links [command] --help" for more information about a command.
anki_as_code api backend-links help-page-link
/anki.links.BackendLinksService/HelpPageLink
Request: anki.links.HelpPageLinkRequest
Response: anki.generic.String
Request fields:
page: optional anki.links.HelpPageLinkRequest.HelpPage
Usage:
anki_as_code api backend-links help-page-link [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for help-page-link
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki.media.BackendMediaService
Usage:
anki_as_code api backend-media [command]
Available Commands:
add-media-file /anki.media.BackendMediaService/AddMediaFile
add-media-from-path /anki.media.BackendMediaService/AddMediaFromPath
add-media-from-url /anki.media.BackendMediaService/AddMediaFromUrl
check-media /anki.media.BackendMediaService/CheckMedia
empty-trash /anki.media.BackendMediaService/EmptyTrash
extract-media-files /anki.media.BackendMediaService/ExtractMediaFiles
extract-static-media-files /anki.media.BackendMediaService/ExtractStaticMediaFiles
get-absolute-media-path /anki.media.BackendMediaService/GetAbsoluteMediaPath
restore-trash /anki.media.BackendMediaService/RestoreTrash
trash-media-files /anki.media.BackendMediaService/TrashMediaFiles
Flags:
-h, --help help for backend-media
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-media [command] --help" for more information about a command.
/anki.media.BackendMediaService/AddMediaFile
Request: anki.media.AddMediaFileRequest
Response: anki.generic.String
Request fields:
desired_name: optional string
data: optional bytes
Usage:
anki_as_code api backend-media add-media-file [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-media-file
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/AddMediaFromPath
Request: anki.media.AddMediaFromPathRequest
Response: anki.generic.String
Request fields:
path: optional string
Usage:
anki_as_code api backend-media add-media-from-path [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-media-from-path
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/AddMediaFromUrl
Request: anki.media.AddMediaFromUrlRequest
Response: anki.media.AddMediaFromUrlResponse
Request fields:
url: optional string
Usage:
anki_as_code api backend-media add-media-from-url [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-media-from-url
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/CheckMedia
Request: anki.generic.Empty
Response: anki.media.CheckMediaResponse
Usage:
anki_as_code api backend-media check-media [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for check-media
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/EmptyTrash
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-media empty-trash [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for empty-trash
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/ExtractMediaFiles
Request: anki.generic.String
Response: anki.generic.StringList
Request fields:
val: optional string
Usage:
anki_as_code api backend-media extract-media-files [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-media-files
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/ExtractStaticMediaFiles
Request: anki.notetypes.NotetypeId
Response: anki.generic.StringList
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-media extract-static-media-files [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-static-media-files
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/GetAbsoluteMediaPath
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api backend-media get-absolute-media-path [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-absolute-media-path
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/RestoreTrash
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-media restore-trash [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for restore-trash
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.BackendMediaService/TrashMediaFiles
Request: anki.media.TrashMediaFilesRequest
Response: anki.generic.Empty
Request fields:
fnames: repeated string
Usage:
anki_as_code api backend-media trash-media-files [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for trash-media-files
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes
anki.notes.BackendNotesService
Usage:
anki_as_code api backend-notes [command]
Available Commands:
add-note /anki.notes.BackendNotesService/AddNote
add-notes /anki.notes.BackendNotesService/AddNotes
after-note-updates /anki.notes.BackendNotesService/AfterNoteUpdates
cards-of-note /anki.notes.BackendNotesService/CardsOfNote
cloze-numbers-in-note /anki.notes.BackendNotesService/ClozeNumbersInNote
default-deck-for-notetype /anki.notes.BackendNotesService/DefaultDeckForNotetype
defaults-for-adding /anki.notes.BackendNotesService/DefaultsForAdding
field-names-for-notes /anki.notes.BackendNotesService/FieldNamesForNotes
get-note /anki.notes.BackendNotesService/GetNote
get-single-notetype-of-notes /anki.notes.BackendNotesService/GetSingleNotetypeOfNotes
new-note /anki.notes.BackendNotesService/NewNote
note-fields-check /anki.notes.BackendNotesService/NoteFieldsCheck
remove-notes /anki.notes.BackendNotesService/RemoveNotes
update-notes /anki.notes.BackendNotesService/UpdateNotes
Flags:
-h, --help help for backend-notes
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-notes [command] --help" for more information about a command.
anki_as_code api backend-notes add-note
/anki.notes.BackendNotesService/AddNote
Request: anki.notes.AddNoteRequest
Response: anki.notes.AddNoteResponse
Request fields:
note: optional anki.notes.Note
deck_id: optional int64
Usage:
anki_as_code api backend-notes add-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes add-notes
/anki.notes.BackendNotesService/AddNotes
Request: anki.notes.AddNotesRequest
Response: anki.notes.AddNotesResponse
Request fields:
requests: repeated anki.notes.AddNoteRequest
Usage:
anki_as_code api backend-notes add-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes after-note-updates
/anki.notes.BackendNotesService/AfterNoteUpdates
Request: anki.notes.AfterNoteUpdatesRequest
Response: anki.collection.OpChangesWithCount
Request fields:
nids: repeated int64
mark_notes_modified: optional bool
generate_cards: optional bool
Usage:
anki_as_code api backend-notes after-note-updates [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for after-note-updates
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes cards-of-note
/anki.notes.BackendNotesService/CardsOfNote
Request: anki.notes.NoteId
Response: anki.cards.CardIds
Request fields:
nid: optional int64
Usage:
anki_as_code api backend-notes cards-of-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for cards-of-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes cloze-numbers-in-note
/anki.notes.BackendNotesService/ClozeNumbersInNote
Request: anki.notes.Note
Response: anki.notes.ClozeNumbersInNoteResponse
Request fields:
id: optional int64
guid: optional string
notetype_id: optional int64
mtime_secs: optional uint32
usn: optional int32
tags: repeated string
fields: repeated string
Usage:
anki_as_code api backend-notes cloze-numbers-in-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for cloze-numbers-in-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes default-deck-for-notetype
/anki.notes.BackendNotesService/DefaultDeckForNotetype
Request: anki.notetypes.NotetypeId
Response: anki.decks.DeckId
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notes default-deck-for-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for default-deck-for-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes defaults-for-adding
/anki.notes.BackendNotesService/DefaultsForAdding
Request: anki.notes.DefaultsForAddingRequest
Response: anki.notes.DeckAndNotetype
Request fields:
home_deck_of_current_review_card: optional int64
Usage:
anki_as_code api backend-notes defaults-for-adding [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for defaults-for-adding
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes field-names-for-notes
/anki.notes.BackendNotesService/FieldNamesForNotes
Request: anki.notes.FieldNamesForNotesRequest
Response: anki.notes.FieldNamesForNotesResponse
Request fields:
nids: repeated int64
Usage:
anki_as_code api backend-notes field-names-for-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for field-names-for-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes get-note
/anki.notes.BackendNotesService/GetNote
Request: anki.notes.NoteId
Response: anki.notes.Note
Request fields:
nid: optional int64
Usage:
anki_as_code api backend-notes get-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes get-single-notetype-of-notes
/anki.notes.BackendNotesService/GetSingleNotetypeOfNotes
Request: anki.notes.NoteIds
Response: anki.notetypes.NotetypeId
Request fields:
note_ids: repeated int64
Usage:
anki_as_code api backend-notes get-single-notetype-of-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-single-notetype-of-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes new-note
/anki.notes.BackendNotesService/NewNote
Request: anki.notetypes.NotetypeId
Response: anki.notes.Note
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notes new-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes note-fields-check
/anki.notes.BackendNotesService/NoteFieldsCheck
Request: anki.notes.Note
Response: anki.notes.NoteFieldsCheckResponse
Request fields:
id: optional int64
guid: optional string
notetype_id: optional int64
mtime_secs: optional uint32
usn: optional int32
tags: repeated string
fields: repeated string
Usage:
anki_as_code api backend-notes note-fields-check [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for note-fields-check
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes remove-notes
/anki.notes.BackendNotesService/RemoveNotes
Request: anki.notes.RemoveNotesRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
card_ids: repeated int64
Usage:
anki_as_code api backend-notes remove-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notes update-notes
/anki.notes.BackendNotesService/UpdateNotes
Request: anki.notes.UpdateNotesRequest
Response: anki.collection.OpChanges
Request fields:
notes: repeated anki.notes.Note
skip_undo_entry: optional bool
Usage:
anki_as_code api backend-notes update-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes
anki.notetypes.BackendNotetypesService
Usage:
anki_as_code api backend-notetypes [command]
Available Commands:
add-notetype /anki.notetypes.BackendNotetypesService/AddNotetype
add-notetype-legacy /anki.notetypes.BackendNotetypesService/AddNotetypeLegacy
add-or-update-notetype /anki.notetypes.BackendNotetypesService/AddOrUpdateNotetype
change-notetype /anki.notetypes.BackendNotetypesService/ChangeNotetype
get-aux-notetype-config-key /anki.notetypes.BackendNotetypesService/GetAuxNotetypeConfigKey
get-aux-template-config-key /anki.notetypes.BackendNotetypesService/GetAuxTemplateConfigKey
get-change-notetype-info /anki.notetypes.BackendNotetypesService/GetChangeNotetypeInfo
get-cloze-field-ords /anki.notetypes.BackendNotetypesService/GetClozeFieldOrds
get-field-names /anki.notetypes.BackendNotetypesService/GetFieldNames
get-notetype /anki.notetypes.BackendNotetypesService/GetNotetype
get-notetype-id-by-name /anki.notetypes.BackendNotetypesService/GetNotetypeIdByName
get-notetype-legacy /anki.notetypes.BackendNotetypesService/GetNotetypeLegacy
get-notetype-names /anki.notetypes.BackendNotetypesService/GetNotetypeNames
get-notetype-names-and-counts /anki.notetypes.BackendNotetypesService/GetNotetypeNamesAndCounts
get-stock-notetype-legacy /anki.notetypes.BackendNotetypesService/GetStockNotetypeLegacy
remove-notetype /anki.notetypes.BackendNotetypesService/RemoveNotetype
restore-notetype-to-stock /anki.notetypes.BackendNotetypesService/RestoreNotetypeToStock
update-notetype /anki.notetypes.BackendNotetypesService/UpdateNotetype
update-notetype-legacy /anki.notetypes.BackendNotetypesService/UpdateNotetypeLegacy
Flags:
-h, --help help for backend-notetypes
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-notetypes [command] --help" for more information about a command.
anki_as_code api backend-notetypes add-notetype
/anki.notetypes.BackendNotetypesService/AddNotetype
Request: anki.notetypes.Notetype
Response: anki.collection.OpChangesWithId
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional sint32
config: optional anki.notetypes.Notetype.Config
fields: repeated anki.notetypes.Notetype.Field
templates: repeated anki.notetypes.Notetype.Template
Usage:
anki_as_code api backend-notetypes add-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes add-notetype-legacy
/anki.notetypes.BackendNotetypesService/AddNotetypeLegacy
Request: anki.generic.Json
Response: anki.collection.OpChangesWithId
Request fields:
json: optional bytes
Usage:
anki_as_code api backend-notetypes add-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes add-or-update-notetype
/anki.notetypes.BackendNotetypesService/AddOrUpdateNotetype
Request: anki.notetypes.AddOrUpdateNotetypeRequest
Response: anki.notetypes.NotetypeId
Request fields:
json: optional bytes
preserve_usn_and_mtime: optional bool
skip_checks: optional bool
Usage:
anki_as_code api backend-notetypes add-or-update-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes change-notetype
/anki.notetypes.BackendNotetypesService/ChangeNotetype
Request: anki.notetypes.ChangeNotetypeRequest
Response: anki.collection.OpChanges
Request fields:
note_ids: repeated int64
new_fields: repeated int32
new_templates: repeated int32
old_notetype_id: optional int64
new_notetype_id: optional int64
current_schema: optional int64
old_notetype_name: optional string
is_cloze: optional bool
Usage:
anki_as_code api backend-notetypes change-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for change-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-aux-notetype-config-key
/anki.notetypes.BackendNotetypesService/GetAuxNotetypeConfigKey
Request: anki.notetypes.GetAuxConfigKeyRequest
Response: anki.generic.String
Request fields:
id: optional int64
key: optional string
Usage:
anki_as_code api backend-notetypes get-aux-notetype-config-key [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-aux-notetype-config-key
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-aux-template-config-key
/anki.notetypes.BackendNotetypesService/GetAuxTemplateConfigKey
Request: anki.notetypes.GetAuxTemplateConfigKeyRequest
Response: anki.generic.String
Request fields:
notetype_id: optional int64
card_ordinal: optional uint32
key: optional string
Usage:
anki_as_code api backend-notetypes get-aux-template-config-key [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-aux-template-config-key
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-change-notetype-info
/anki.notetypes.BackendNotetypesService/GetChangeNotetypeInfo
Request: anki.notetypes.GetChangeNotetypeInfoRequest
Response: anki.notetypes.ChangeNotetypeInfo
Request fields:
old_notetype_id: optional int64
new_notetype_id: optional int64
Usage:
anki_as_code api backend-notetypes get-change-notetype-info [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-change-notetype-info
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-cloze-field-ords
/anki.notetypes.BackendNotetypesService/GetClozeFieldOrds
Request: anki.notetypes.NotetypeId
Response: anki.notetypes.GetClozeFieldOrdsResponse
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notetypes get-cloze-field-ords [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-cloze-field-ords
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-field-names
/anki.notetypes.BackendNotetypesService/GetFieldNames
Request: anki.notetypes.NotetypeId
Response: anki.generic.StringList
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notetypes get-field-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-field-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-notetype
/anki.notetypes.BackendNotetypesService/GetNotetype
Request: anki.notetypes.NotetypeId
Response: anki.notetypes.Notetype
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notetypes get-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-notetype-id-by-name
/anki.notetypes.BackendNotetypesService/GetNotetypeIdByName
Request: anki.generic.String
Response: anki.notetypes.NotetypeId
Request fields:
val: optional string
Usage:
anki_as_code api backend-notetypes get-notetype-id-by-name [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-id-by-name
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-notetype-legacy
/anki.notetypes.BackendNotetypesService/GetNotetypeLegacy
Request: anki.notetypes.NotetypeId
Response: anki.generic.Json
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notetypes get-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-notetype-names
/anki.notetypes.BackendNotetypesService/GetNotetypeNames
Request: anki.generic.Empty
Response: anki.notetypes.NotetypeNames
Usage:
anki_as_code api backend-notetypes get-notetype-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-notetype-names-and-counts
/anki.notetypes.BackendNotetypesService/GetNotetypeNamesAndCounts
Request: anki.generic.Empty
Response: anki.notetypes.NotetypeUseCounts
Usage:
anki_as_code api backend-notetypes get-notetype-names-and-counts [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-names-and-counts
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes get-stock-notetype-legacy
/anki.notetypes.BackendNotetypesService/GetStockNotetypeLegacy
Request: anki.notetypes.StockNotetype
Response: anki.generic.Json
Request fields:
kind: optional anki.notetypes.StockNotetype.Kind
Usage:
anki_as_code api backend-notetypes get-stock-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-stock-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes remove-notetype
/anki.notetypes.BackendNotetypesService/RemoveNotetype
Request: anki.notetypes.NotetypeId
Response: anki.collection.OpChanges
Request fields:
ntid: optional int64
Usage:
anki_as_code api backend-notetypes remove-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes restore-notetype-to-stock
/anki.notetypes.BackendNotetypesService/RestoreNotetypeToStock
Request: anki.notetypes.RestoreNotetypeToStockRequest
Response: anki.collection.OpChanges
Request fields:
notetype_id: optional anki.notetypes.NotetypeId
force_kind: optional anki.notetypes.StockNotetype.Kind
Usage:
anki_as_code api backend-notetypes restore-notetype-to-stock [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for restore-notetype-to-stock
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes update-notetype
/anki.notetypes.BackendNotetypesService/UpdateNotetype
Request: anki.notetypes.Notetype
Response: anki.collection.OpChanges
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional sint32
config: optional anki.notetypes.Notetype.Config
fields: repeated anki.notetypes.Notetype.Field
templates: repeated anki.notetypes.Notetype.Template
Usage:
anki_as_code api backend-notetypes update-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-notetypes update-notetype-legacy
/anki.notetypes.BackendNotetypesService/UpdateNotetypeLegacy
Request: anki.notetypes.UpdateNotetypeLegacyRequest
Response: anki.collection.OpChanges
Request fields:
json: optional bytes
skip_checks: optional bool
Usage:
anki_as_code api backend-notetypes update-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler
anki.scheduler.BackendSchedulerService
Usage:
anki_as_code api backend-scheduler [command]
Available Commands:
answer-card /anki.scheduler.BackendSchedulerService/AnswerCard
bury-or-suspend-cards /anki.scheduler.BackendSchedulerService/BuryOrSuspendCards
compute-fsrs-params /anki.scheduler.BackendSchedulerService/ComputeFsrsParams
compute-fsrs-params-from-items /anki.scheduler.BackendSchedulerService/ComputeFsrsParamsFromItems
compute-memory-state /anki.scheduler.BackendSchedulerService/ComputeMemoryState
compute-optimal-retention /anki.scheduler.BackendSchedulerService/ComputeOptimalRetention
congrats-info /anki.scheduler.BackendSchedulerService/CongratsInfo
counts-for-deck-today /anki.scheduler.BackendSchedulerService/CountsForDeckToday
custom-study /anki.scheduler.BackendSchedulerService/CustomStudy
custom-study-defaults /anki.scheduler.BackendSchedulerService/CustomStudyDefaults
describe-next-states /anki.scheduler.BackendSchedulerService/DescribeNextStates
empty-filtered-deck /anki.scheduler.BackendSchedulerService/EmptyFilteredDeck
evaluate-params /anki.scheduler.BackendSchedulerService/EvaluateParams
evaluate-params-legacy /anki.scheduler.BackendSchedulerService/EvaluateParamsLegacy
export-dataset /anki.scheduler.BackendSchedulerService/ExportDataset
extend-limits /anki.scheduler.BackendSchedulerService/ExtendLimits
fsrs-benchmark /anki.scheduler.BackendSchedulerService/FsrsBenchmark
fuzz-delta /anki.scheduler.BackendSchedulerService/FuzzDelta
get-optimal-retention-parameters /anki.scheduler.BackendSchedulerService/GetOptimalRetentionParameters
get-queued-cards /anki.scheduler.BackendSchedulerService/GetQueuedCards
get-scheduling-states /anki.scheduler.BackendSchedulerService/GetSchedulingStates
grade-now /anki.scheduler.BackendSchedulerService/GradeNow
rebuild-filtered-deck /anki.scheduler.BackendSchedulerService/RebuildFilteredDeck
reposition-defaults /anki.scheduler.BackendSchedulerService/RepositionDefaults
restore-buried-and-suspended-cards /anki.scheduler.BackendSchedulerService/RestoreBuriedAndSuspendedCards
sched-timing-today /anki.scheduler.BackendSchedulerService/SchedTimingToday
schedule-cards-as-new /anki.scheduler.BackendSchedulerService/ScheduleCardsAsNew
schedule-cards-as-new-defaults /anki.scheduler.BackendSchedulerService/ScheduleCardsAsNewDefaults
set-due-date /anki.scheduler.BackendSchedulerService/SetDueDate
simulate-fsrs-review /anki.scheduler.BackendSchedulerService/SimulateFsrsReview
simulate-fsrs-workload /anki.scheduler.BackendSchedulerService/SimulateFsrsWorkload
sort-cards /anki.scheduler.BackendSchedulerService/SortCards
sort-deck /anki.scheduler.BackendSchedulerService/SortDeck
state-is-leech /anki.scheduler.BackendSchedulerService/StateIsLeech
studied-today /anki.scheduler.BackendSchedulerService/StudiedToday
studied-today-message /anki.scheduler.BackendSchedulerService/StudiedTodayMessage
unbury-deck /anki.scheduler.BackendSchedulerService/UnburyDeck
update-stats /anki.scheduler.BackendSchedulerService/UpdateStats
upgrade-scheduler /anki.scheduler.BackendSchedulerService/UpgradeScheduler
Flags:
-h, --help help for backend-scheduler
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-scheduler [command] --help" for more information about a command.
anki_as_code api backend-scheduler answer-card
/anki.scheduler.BackendSchedulerService/AnswerCard
Request: anki.scheduler.CardAnswer
Response: anki.collection.OpChanges
Request fields:
card_id: optional int64
current_state: optional anki.scheduler.SchedulingState
new_state: optional anki.scheduler.SchedulingState
rating: optional anki.scheduler.CardAnswer.Rating
answered_at_millis: optional int64
milliseconds_taken: optional uint32
Usage:
anki_as_code api backend-scheduler answer-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for answer-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler bury-or-suspend-cards
/anki.scheduler.BackendSchedulerService/BuryOrSuspendCards
Request: anki.scheduler.BuryOrSuspendCardsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
note_ids: repeated int64
mode: optional anki.scheduler.BuryOrSuspendCardsRequest.Mode
Usage:
anki_as_code api backend-scheduler bury-or-suspend-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for bury-or-suspend-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler compute-fsrs-params
/anki.scheduler.BackendSchedulerService/ComputeFsrsParams
Request: anki.scheduler.ComputeFsrsParamsRequest
Response: anki.scheduler.ComputeFsrsParamsResponse
Request fields:
search: optional string
current_params: repeated float
ignore_revlogs_before_ms: optional int64
num_of_relearning_steps: optional uint32
health_check: optional bool
Usage:
anki_as_code api backend-scheduler compute-fsrs-params [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-fsrs-params
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler compute-fsrs-params-from-items
/anki.scheduler.BackendSchedulerService/ComputeFsrsParamsFromItems
Request: anki.scheduler.ComputeFsrsParamsFromItemsRequest
Response: anki.scheduler.ComputeFsrsParamsResponse
Request fields:
items: repeated anki.scheduler.FsrsItem
Usage:
anki_as_code api backend-scheduler compute-fsrs-params-from-items [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-fsrs-params-from-items
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler compute-memory-state
/anki.scheduler.BackendSchedulerService/ComputeMemoryState
Request: anki.cards.CardId
Response: anki.scheduler.ComputeMemoryStateResponse
Request fields:
cid: optional int64
Usage:
anki_as_code api backend-scheduler compute-memory-state [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-memory-state
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler compute-optimal-retention
/anki.scheduler.BackendSchedulerService/ComputeOptimalRetention
Request: anki.scheduler.SimulateFsrsReviewRequest
Response: anki.scheduler.ComputeOptimalRetentionResponse
Request fields:
params: repeated float
desired_retention: optional float
deck_size: optional uint32
days_to_simulate: optional uint32
new_limit: optional uint32
review_limit: optional uint32
max_interval: optional uint32
search: optional string
new_cards_ignore_review_limit: optional bool
easy_days_percentages: repeated float
review_order: optional anki.deck_config.DeckConfig.Config.ReviewCardOrder
suspend_after_lapse_count: optional uint32
historical_retention: optional float
learning_step_count: optional uint32
relearning_step_count: optional uint32
Usage:
anki_as_code api backend-scheduler compute-optimal-retention [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-optimal-retention
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler congrats-info
/anki.scheduler.BackendSchedulerService/CongratsInfo
Request: anki.generic.Empty
Response: anki.scheduler.CongratsInfoResponse
Usage:
anki_as_code api backend-scheduler congrats-info [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for congrats-info
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler counts-for-deck-today
/anki.scheduler.BackendSchedulerService/CountsForDeckToday
Request: anki.decks.DeckId
Response: anki.scheduler.CountsForDeckTodayResponse
Request fields:
did: optional int64
Usage:
anki_as_code api backend-scheduler counts-for-deck-today [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for counts-for-deck-today
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler custom-study
/anki.scheduler.BackendSchedulerService/CustomStudy
Request: anki.scheduler.CustomStudyRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
new_limit_delta: optional int32
review_limit_delta: optional int32
forgot_days: optional uint32
review_ahead_days: optional uint32
preview_days: optional uint32
cram: optional anki.scheduler.CustomStudyRequest.Cram
Usage:
anki_as_code api backend-scheduler custom-study [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for custom-study
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler custom-study-defaults
/anki.scheduler.BackendSchedulerService/CustomStudyDefaults
Request: anki.scheduler.CustomStudyDefaultsRequest
Response: anki.scheduler.CustomStudyDefaultsResponse
Request fields:
deck_id: optional int64
Usage:
anki_as_code api backend-scheduler custom-study-defaults [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for custom-study-defaults
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler describe-next-states
/anki.scheduler.BackendSchedulerService/DescribeNextStates
Request: anki.scheduler.SchedulingStates
Response: anki.generic.StringList
Request fields:
current: optional anki.scheduler.SchedulingState
again: optional anki.scheduler.SchedulingState
hard: optional anki.scheduler.SchedulingState
good: optional anki.scheduler.SchedulingState
easy: optional anki.scheduler.SchedulingState
Usage:
anki_as_code api backend-scheduler describe-next-states [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for describe-next-states
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler empty-filtered-deck
/anki.scheduler.BackendSchedulerService/EmptyFilteredDeck
Request: anki.decks.DeckId
Response: anki.collection.OpChanges
Request fields:
did: optional int64
Usage:
anki_as_code api backend-scheduler empty-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for empty-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler evaluate-params
/anki.scheduler.BackendSchedulerService/EvaluateParams
Request: anki.scheduler.EvaluateParamsRequest
Response: anki.scheduler.EvaluateParamsResponse
Request fields:
search: optional string
ignore_revlogs_before_ms: optional int64
num_of_relearning_steps: optional uint32
Usage:
anki_as_code api backend-scheduler evaluate-params [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for evaluate-params
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler evaluate-params-legacy
/anki.scheduler.BackendSchedulerService/EvaluateParamsLegacy
Request: anki.scheduler.EvaluateParamsLegacyRequest
Response: anki.scheduler.EvaluateParamsResponse
Request fields:
params: repeated float
search: optional string
ignore_revlogs_before_ms: optional int64
Usage:
anki_as_code api backend-scheduler evaluate-params-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for evaluate-params-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler export-dataset
/anki.scheduler.BackendSchedulerService/ExportDataset
Request: anki.scheduler.ExportDatasetRequest
Response: anki.generic.Empty
Request fields:
min_entries: optional uint32
target_path: optional string
Usage:
anki_as_code api backend-scheduler export-dataset [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-dataset
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler extend-limits
/anki.scheduler.BackendSchedulerService/ExtendLimits
Request: anki.scheduler.ExtendLimitsRequest
Response: anki.generic.Empty
Request fields:
deck_id: optional int64
new_delta: optional int32
review_delta: optional int32
Usage:
anki_as_code api backend-scheduler extend-limits [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extend-limits
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler fsrs-benchmark
/anki.scheduler.BackendSchedulerService/FsrsBenchmark
Request: anki.scheduler.FsrsBenchmarkRequest
Response: anki.scheduler.FsrsBenchmarkResponse
Request fields:
train_set: repeated anki.scheduler.FsrsItem
Usage:
anki_as_code api backend-scheduler fsrs-benchmark [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for fsrs-benchmark
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler fuzz-delta
/anki.scheduler.BackendSchedulerService/FuzzDelta
Request: anki.scheduler.FuzzDeltaRequest
Response: anki.scheduler.FuzzDeltaResponse
Request fields:
card_id: optional int64
interval: optional uint32
Usage:
anki_as_code api backend-scheduler fuzz-delta [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for fuzz-delta
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler get-optimal-retention-parameters
/anki.scheduler.BackendSchedulerService/GetOptimalRetentionParameters
Request: anki.scheduler.GetOptimalRetentionParametersRequest
Response: anki.scheduler.GetOptimalRetentionParametersResponse
Request fields:
search: optional string
Usage:
anki_as_code api backend-scheduler get-optimal-retention-parameters [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-optimal-retention-parameters
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler get-queued-cards
/anki.scheduler.BackendSchedulerService/GetQueuedCards
Request: anki.scheduler.GetQueuedCardsRequest
Response: anki.scheduler.QueuedCards
Request fields:
fetch_limit: optional uint32
intraday_learning_only: optional bool
Usage:
anki_as_code api backend-scheduler get-queued-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-queued-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler get-scheduling-states
/anki.scheduler.BackendSchedulerService/GetSchedulingStates
Request: anki.cards.CardId
Response: anki.scheduler.SchedulingStates
Request fields:
cid: optional int64
Usage:
anki_as_code api backend-scheduler get-scheduling-states [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-scheduling-states
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler grade-now
/anki.scheduler.BackendSchedulerService/GradeNow
Request: anki.scheduler.GradeNowRequest
Response: anki.collection.OpChanges
Request fields:
card_ids: repeated int64
rating: optional anki.scheduler.CardAnswer.Rating
Usage:
anki_as_code api backend-scheduler grade-now [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for grade-now
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler rebuild-filtered-deck
/anki.scheduler.BackendSchedulerService/RebuildFilteredDeck
Request: anki.decks.DeckId
Response: anki.collection.OpChangesWithCount
Request fields:
did: optional int64
Usage:
anki_as_code api backend-scheduler rebuild-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for rebuild-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler reposition-defaults
/anki.scheduler.BackendSchedulerService/RepositionDefaults
Request: anki.generic.Empty
Response: anki.scheduler.RepositionDefaultsResponse
Usage:
anki_as_code api backend-scheduler reposition-defaults [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for reposition-defaults
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler restore-buried-and-suspended-cards
/anki.scheduler.BackendSchedulerService/RestoreBuriedAndSuspendedCards
Request: anki.cards.CardIds
Response: anki.collection.OpChanges
Request fields:
cids: repeated int64
Usage:
anki_as_code api backend-scheduler restore-buried-and-suspended-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for restore-buried-and-suspended-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler sched-timing-today
/anki.scheduler.BackendSchedulerService/SchedTimingToday
Request: anki.generic.Empty
Response: anki.scheduler.SchedTimingTodayResponse
Usage:
anki_as_code api backend-scheduler sched-timing-today [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sched-timing-today
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler schedule-cards-as-new
/anki.scheduler.BackendSchedulerService/ScheduleCardsAsNew
Request: anki.scheduler.ScheduleCardsAsNewRequest
Response: anki.collection.OpChanges
Request fields:
card_ids: repeated int64
log: optional bool
restore_position: optional bool
reset_counts: optional bool
context: optional anki.scheduler.ScheduleCardsAsNewRequest.Context
Usage:
anki_as_code api backend-scheduler schedule-cards-as-new [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for schedule-cards-as-new
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler schedule-cards-as-new-defaults
/anki.scheduler.BackendSchedulerService/ScheduleCardsAsNewDefaults
Request: anki.scheduler.ScheduleCardsAsNewDefaultsRequest
Response: anki.scheduler.ScheduleCardsAsNewDefaultsResponse
Request fields:
context: optional anki.scheduler.ScheduleCardsAsNewRequest.Context
Usage:
anki_as_code api backend-scheduler schedule-cards-as-new-defaults [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for schedule-cards-as-new-defaults
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler set-due-date
/anki.scheduler.BackendSchedulerService/SetDueDate
Request: anki.scheduler.SetDueDateRequest
Response: anki.collection.OpChanges
Request fields:
card_ids: repeated int64
days: optional string
config_key: optional anki.config.OptionalStringConfigKey
Usage:
anki_as_code api backend-scheduler set-due-date [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-due-date
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler simulate-fsrs-review
/anki.scheduler.BackendSchedulerService/SimulateFsrsReview
Request: anki.scheduler.SimulateFsrsReviewRequest
Response: anki.scheduler.SimulateFsrsReviewResponse
Request fields:
params: repeated float
desired_retention: optional float
deck_size: optional uint32
days_to_simulate: optional uint32
new_limit: optional uint32
review_limit: optional uint32
max_interval: optional uint32
search: optional string
new_cards_ignore_review_limit: optional bool
easy_days_percentages: repeated float
review_order: optional anki.deck_config.DeckConfig.Config.ReviewCardOrder
suspend_after_lapse_count: optional uint32
historical_retention: optional float
learning_step_count: optional uint32
relearning_step_count: optional uint32
Usage:
anki_as_code api backend-scheduler simulate-fsrs-review [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for simulate-fsrs-review
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler simulate-fsrs-workload
/anki.scheduler.BackendSchedulerService/SimulateFsrsWorkload
Request: anki.scheduler.SimulateFsrsReviewRequest
Response: anki.scheduler.SimulateFsrsWorkloadResponse
Request fields:
params: repeated float
desired_retention: optional float
deck_size: optional uint32
days_to_simulate: optional uint32
new_limit: optional uint32
review_limit: optional uint32
max_interval: optional uint32
search: optional string
new_cards_ignore_review_limit: optional bool
easy_days_percentages: repeated float
review_order: optional anki.deck_config.DeckConfig.Config.ReviewCardOrder
suspend_after_lapse_count: optional uint32
historical_retention: optional float
learning_step_count: optional uint32
relearning_step_count: optional uint32
Usage:
anki_as_code api backend-scheduler simulate-fsrs-workload [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for simulate-fsrs-workload
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler sort-cards
/anki.scheduler.BackendSchedulerService/SortCards
Request: anki.scheduler.SortCardsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
starting_from: optional uint32
step_size: optional uint32
randomize: optional bool
shift_existing: optional bool
Usage:
anki_as_code api backend-scheduler sort-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sort-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler sort-deck
/anki.scheduler.BackendSchedulerService/SortDeck
Request: anki.scheduler.SortDeckRequest
Response: anki.collection.OpChangesWithCount
Request fields:
deck_id: optional int64
randomize: optional bool
Usage:
anki_as_code api backend-scheduler sort-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sort-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler state-is-leech
/anki.scheduler.BackendSchedulerService/StateIsLeech
Request: anki.scheduler.SchedulingState
Response: anki.generic.Bool
Request fields:
normal: optional anki.scheduler.SchedulingState.Normal
filtered: optional anki.scheduler.SchedulingState.Filtered
custom_data: optional string
Usage:
anki_as_code api backend-scheduler state-is-leech [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for state-is-leech
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler studied-today
/anki.scheduler.BackendSchedulerService/StudiedToday
Request: anki.generic.Empty
Response: anki.generic.String
Usage:
anki_as_code api backend-scheduler studied-today [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for studied-today
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler studied-today-message
/anki.scheduler.BackendSchedulerService/StudiedTodayMessage
Request: anki.scheduler.StudiedTodayMessageRequest
Response: anki.generic.String
Request fields:
cards: optional uint32
seconds: optional double
Usage:
anki_as_code api backend-scheduler studied-today-message [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for studied-today-message
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler unbury-deck
/anki.scheduler.BackendSchedulerService/UnburyDeck
Request: anki.scheduler.UnburyDeckRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
mode: optional anki.scheduler.UnburyDeckRequest.Mode
Usage:
anki_as_code api backend-scheduler unbury-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for unbury-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler update-stats
/anki.scheduler.BackendSchedulerService/UpdateStats
Request: anki.scheduler.UpdateStatsRequest
Response: anki.generic.Empty
Request fields:
deck_id: optional int64
new_delta: optional int32
review_delta: optional int32
millisecond_delta: optional int32
Usage:
anki_as_code api backend-scheduler update-stats [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-stats
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-scheduler upgrade-scheduler
/anki.scheduler.BackendSchedulerService/UpgradeScheduler
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-scheduler upgrade-scheduler [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for upgrade-scheduler
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search
anki.search.BackendSearchService
Usage:
anki_as_code api backend-search [command]
Available Commands:
all-browser-columns /anki.search.BackendSearchService/AllBrowserColumns
browser-row-for-id /anki.search.BackendSearchService/BrowserRowForId
build-search-string /anki.search.BackendSearchService/BuildSearchString
find-and-replace /anki.search.BackendSearchService/FindAndReplace
join-search-nodes /anki.search.BackendSearchService/JoinSearchNodes
replace-search-node /anki.search.BackendSearchService/ReplaceSearchNode
search-cards /anki.search.BackendSearchService/SearchCards
search-notes /anki.search.BackendSearchService/SearchNotes
set-active-browser-columns /anki.search.BackendSearchService/SetActiveBrowserColumns
Flags:
-h, --help help for backend-search
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-search [command] --help" for more information about a command.
anki_as_code api backend-search all-browser-columns
/anki.search.BackendSearchService/AllBrowserColumns
Request: anki.generic.Empty
Response: anki.search.BrowserColumns
Usage:
anki_as_code api backend-search all-browser-columns [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-browser-columns
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search browser-row-for-id
/anki.search.BackendSearchService/BrowserRowForId
Request: anki.generic.Int64
Response: anki.search.BrowserRow
Request fields:
val: optional int64
Usage:
anki_as_code api backend-search browser-row-for-id [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for browser-row-for-id
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search build-search-string
/anki.search.BackendSearchService/BuildSearchString
Request: anki.search.SearchNode
Response: anki.generic.String
Request fields:
group: optional anki.search.SearchNode.Group
negated: optional anki.search.SearchNode
parsable_text: optional string
template: optional uint32
nid: optional int64
dupe: optional anki.search.SearchNode.Dupe
field_name: optional string
rated: optional anki.search.SearchNode.Rated
added_in_days: optional uint32
due_in_days: optional int32
flag: optional anki.search.SearchNode.Flag
card_state: optional anki.search.SearchNode.CardState
nids: optional anki.search.SearchNode.IdList
edited_in_days: optional uint32
deck: optional string
due_on_day: optional int32
tag: optional string
note: optional string
introduced_in_days: optional uint32
field: optional anki.search.SearchNode.Field
literal_text: optional string
Usage:
anki_as_code api backend-search build-search-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for build-search-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search find-and-replace
/anki.search.BackendSearchService/FindAndReplace
Request: anki.search.FindAndReplaceRequest
Response: anki.collection.OpChangesWithCount
Request fields:
nids: repeated int64
search: optional string
replacement: optional string
regex: optional bool
match_case: optional bool
field_name: optional string
Usage:
anki_as_code api backend-search find-and-replace [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for find-and-replace
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search join-search-nodes
/anki.search.BackendSearchService/JoinSearchNodes
Request: anki.search.JoinSearchNodesRequest
Response: anki.generic.String
Request fields:
joiner: optional anki.search.SearchNode.Group.Joiner
existing_node: optional anki.search.SearchNode
additional_node: optional anki.search.SearchNode
Usage:
anki_as_code api backend-search join-search-nodes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for join-search-nodes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search replace-search-node
/anki.search.BackendSearchService/ReplaceSearchNode
Request: anki.search.ReplaceSearchNodeRequest
Response: anki.generic.String
Request fields:
existing_node: optional anki.search.SearchNode
replacement_node: optional anki.search.SearchNode
Usage:
anki_as_code api backend-search replace-search-node [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for replace-search-node
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search search-cards
/anki.search.BackendSearchService/SearchCards
Request: anki.search.SearchRequest
Response: anki.search.SearchResponse
Request fields:
search: optional string
order: optional anki.search.SortOrder
Usage:
anki_as_code api backend-search search-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for search-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search search-notes
/anki.search.BackendSearchService/SearchNotes
Request: anki.search.SearchRequest
Response: anki.search.SearchResponse
Request fields:
search: optional string
order: optional anki.search.SortOrder
Usage:
anki_as_code api backend-search search-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for search-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-search set-active-browser-columns
/anki.search.BackendSearchService/SetActiveBrowserColumns
Request: anki.generic.StringList
Response: anki.generic.Empty
Request fields:
vals: repeated string
Usage:
anki_as_code api backend-search set-active-browser-columns [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-active-browser-columns
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-stats
anki.stats.BackendStatsService
Usage:
anki_as_code api backend-stats [command]
Available Commands:
card-stats /anki.stats.BackendStatsService/CardStats
get-graph-preferences /anki.stats.BackendStatsService/GetGraphPreferences
get-review-logs /anki.stats.BackendStatsService/GetReviewLogs
graphs /anki.stats.BackendStatsService/Graphs
set-graph-preferences /anki.stats.BackendStatsService/SetGraphPreferences
Flags:
-h, --help help for backend-stats
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-stats [command] --help" for more information about a command.
anki_as_code api backend-stats card-stats
/anki.stats.BackendStatsService/CardStats
Request: anki.cards.CardId
Response: anki.stats.CardStatsResponse
Request fields:
cid: optional int64
Usage:
anki_as_code api backend-stats card-stats [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for card-stats
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-stats get-graph-preferences
/anki.stats.BackendStatsService/GetGraphPreferences
Request: anki.generic.Empty
Response: anki.stats.GraphPreferences
Usage:
anki_as_code api backend-stats get-graph-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-graph-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-stats get-review-logs
/anki.stats.BackendStatsService/GetReviewLogs
Request: anki.cards.CardId
Response: anki.stats.ReviewLogs
Request fields:
cid: optional int64
Usage:
anki_as_code api backend-stats get-review-logs [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-review-logs
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-stats graphs
/anki.stats.BackendStatsService/Graphs
Request: anki.stats.GraphsRequest
Response: anki.stats.GraphsResponse
Request fields:
search: optional string
days: optional uint32
Usage:
anki_as_code api backend-stats graphs [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for graphs
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-stats set-graph-preferences
/anki.stats.BackendStatsService/SetGraphPreferences
Request: anki.stats.GraphPreferences
Response: anki.generic.Empty
Request fields:
calendar_first_day_of_week: optional anki.stats.GraphPreferences.Weekday
card_counts_separate_inactive: optional bool
browser_links_supported: optional bool
future_due_show_backlog: optional bool
Usage:
anki_as_code api backend-stats set-graph-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-graph-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync
anki.sync.BackendSyncService
Usage:
anki_as_code api backend-sync [command]
Available Commands:
abort-media-sync /anki.sync.BackendSyncService/AbortMediaSync
abort-sync /anki.sync.BackendSyncService/AbortSync
full-upload-or-download /anki.sync.BackendSyncService/FullUploadOrDownload
media-sync-status /anki.sync.BackendSyncService/MediaSyncStatus
set-custom-certificate /anki.sync.BackendSyncService/SetCustomCertificate
sync-collection /anki.sync.BackendSyncService/SyncCollection
sync-login /anki.sync.BackendSyncService/SyncLogin
sync-media /anki.sync.BackendSyncService/SyncMedia
sync-status /anki.sync.BackendSyncService/SyncStatus
Flags:
-h, --help help for backend-sync
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-sync [command] --help" for more information about a command.
/anki.sync.BackendSyncService/AbortMediaSync
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-sync abort-media-sync [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for abort-media-sync
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync abort-sync
/anki.sync.BackendSyncService/AbortSync
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api backend-sync abort-sync [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for abort-sync
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync full-upload-or-download
/anki.sync.BackendSyncService/FullUploadOrDownload
Request: anki.sync.FullUploadOrDownloadRequest
Response: anki.generic.Empty
Request fields:
auth: optional anki.sync.SyncAuth
upload: optional bool
server_usn: optional int32
Usage:
anki_as_code api backend-sync full-upload-or-download [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for full-upload-or-download
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.sync.BackendSyncService/MediaSyncStatus
Request: anki.generic.Empty
Response: anki.sync.MediaSyncStatusResponse
Usage:
anki_as_code api backend-sync media-sync-status [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for media-sync-status
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync set-custom-certificate
/anki.sync.BackendSyncService/SetCustomCertificate
Request: anki.generic.String
Response: anki.generic.Bool
Request fields:
val: optional string
Usage:
anki_as_code api backend-sync set-custom-certificate [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-custom-certificate
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync sync-collection
/anki.sync.BackendSyncService/SyncCollection
Request: anki.sync.SyncCollectionRequest
Response: anki.sync.SyncCollectionResponse
Request fields:
auth: optional anki.sync.SyncAuth
sync_media: optional bool
Usage:
anki_as_code api backend-sync sync-collection [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sync-collection
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync sync-login
/anki.sync.BackendSyncService/SyncLogin
Request: anki.sync.SyncLoginRequest
Response: anki.sync.SyncAuth
Request fields:
username: optional string
password: optional string
endpoint: optional string
Usage:
anki_as_code api backend-sync sync-login [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sync-login
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.sync.BackendSyncService/SyncMedia
Request: anki.sync.SyncAuth
Response: anki.generic.Empty
Request fields:
hkey: optional string
endpoint: optional string
io_timeout_secs: optional uint32
Usage:
anki_as_code api backend-sync sync-media [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sync-media
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api backend-sync sync-status
/anki.sync.BackendSyncService/SyncStatus
Request: anki.sync.SyncAuth
Response: anki.sync.SyncStatusResponse
Request fields:
hkey: optional string
endpoint: optional string
io_timeout_secs: optional uint32
Usage:
anki_as_code api backend-sync sync-status [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sync-status
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki.tags.BackendTagsService
Usage:
anki_as_code api backend-tags [command]
Available Commands:
add-note-tags /anki.tags.BackendTagsService/AddNoteTags
all-tags /anki.tags.BackendTagsService/AllTags
clear-unused-tags /anki.tags.BackendTagsService/ClearUnusedTags
complete-tag /anki.tags.BackendTagsService/CompleteTag
find-and-replace-tag /anki.tags.BackendTagsService/FindAndReplaceTag
remove-note-tags /anki.tags.BackendTagsService/RemoveNoteTags
remove-tags /anki.tags.BackendTagsService/RemoveTags
rename-tags /anki.tags.BackendTagsService/RenameTags
reparent-tags /anki.tags.BackendTagsService/ReparentTags
set-tag-collapsed /anki.tags.BackendTagsService/SetTagCollapsed
tag-tree /anki.tags.BackendTagsService/TagTree
Flags:
-h, --help help for backend-tags
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api backend-tags [command] --help" for more information about a command.
/anki.tags.BackendTagsService/AddNoteTags
Request: anki.tags.NoteIdsAndTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
tags: optional string
Usage:
anki_as_code api backend-tags add-note-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-note-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/AllTags
Request: anki.generic.Empty
Response: anki.generic.StringList
Usage:
anki_as_code api backend-tags all-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/ClearUnusedTags
Request: anki.generic.Empty
Response: anki.collection.OpChangesWithCount
Usage:
anki_as_code api backend-tags clear-unused-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for clear-unused-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/CompleteTag
Request: anki.tags.CompleteTagRequest
Response: anki.tags.CompleteTagResponse
Request fields:
input: optional string
match_limit: optional uint32
Usage:
anki_as_code api backend-tags complete-tag [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for complete-tag
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/FindAndReplaceTag
Request: anki.tags.FindAndReplaceTagRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
search: optional string
replacement: optional string
regex: optional bool
match_case: optional bool
Usage:
anki_as_code api backend-tags find-and-replace-tag [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for find-and-replace-tag
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/RemoveNoteTags
Request: anki.tags.NoteIdsAndTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
tags: optional string
Usage:
anki_as_code api backend-tags remove-note-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-note-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/RemoveTags
Request: anki.generic.String
Response: anki.collection.OpChangesWithCount
Request fields:
val: optional string
Usage:
anki_as_code api backend-tags remove-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/RenameTags
Request: anki.tags.RenameTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
current_prefix: optional string
new_prefix: optional string
Usage:
anki_as_code api backend-tags rename-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for rename-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/ReparentTags
Request: anki.tags.ReparentTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
tags: repeated string
new_parent: optional string
Usage:
anki_as_code api backend-tags reparent-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for reparent-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/SetTagCollapsed
Request: anki.tags.SetTagCollapsedRequest
Response: anki.collection.OpChanges
Request fields:
name: optional string
collapsed: optional bool
Usage:
anki_as_code api backend-tags set-tag-collapsed [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-tag-collapsed
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.BackendTagsService/TagTree
Request: anki.generic.Empty
Response: anki.tags.TagTreeNode
Usage:
anki_as_code api backend-tags tag-tree [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for tag-tree
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering
anki.card_rendering.CardRenderingService
Usage:
anki_as_code api card-rendering [command]
Available Commands:
compare-answer /anki.card_rendering.CardRenderingService/CompareAnswer
decode-iri-paths /anki.card_rendering.CardRenderingService/DecodeIriPaths
encode-iri-paths /anki.card_rendering.CardRenderingService/EncodeIriPaths
extract-av-tags /anki.card_rendering.CardRenderingService/ExtractAvTags
extract-cloze-for-typing /anki.card_rendering.CardRenderingService/ExtractClozeForTyping
extract-latex /anki.card_rendering.CardRenderingService/ExtractLatex
get-empty-cards /anki.card_rendering.CardRenderingService/GetEmptyCards
html-to-text-line /anki.card_rendering.CardRenderingService/HtmlToTextLine
render-existing-card /anki.card_rendering.CardRenderingService/RenderExistingCard
render-markdown /anki.card_rendering.CardRenderingService/RenderMarkdown
render-uncommitted-card /anki.card_rendering.CardRenderingService/RenderUncommittedCard
render-uncommitted-card-legacy /anki.card_rendering.CardRenderingService/RenderUncommittedCardLegacy
strip-av-tags /anki.card_rendering.CardRenderingService/StripAvTags
strip-html /anki.card_rendering.CardRenderingService/StripHtml
Flags:
-h, --help help for card-rendering
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api card-rendering [command] --help" for more information about a command.
anki_as_code api card-rendering compare-answer
/anki.card_rendering.CardRenderingService/CompareAnswer
Request: anki.card_rendering.CompareAnswerRequest
Response: anki.generic.String
Request fields:
expected: optional string
provided: optional string
combining: optional bool
Usage:
anki_as_code api card-rendering compare-answer [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compare-answer
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering decode-iri-paths
/anki.card_rendering.CardRenderingService/DecodeIriPaths
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api card-rendering decode-iri-paths [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for decode-iri-paths
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering encode-iri-paths
/anki.card_rendering.CardRenderingService/EncodeIriPaths
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api card-rendering encode-iri-paths [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for encode-iri-paths
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.CardRenderingService/ExtractAvTags
Request: anki.card_rendering.ExtractAvTagsRequest
Response: anki.card_rendering.ExtractAvTagsResponse
Request fields:
text: optional string
question_side: optional bool
Usage:
anki_as_code api card-rendering extract-av-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-av-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.CardRenderingService/ExtractClozeForTyping
Request: anki.card_rendering.ExtractClozeForTypingRequest
Response: anki.generic.String
Request fields:
text: optional string
ordinal: optional uint32
Usage:
anki_as_code api card-rendering extract-cloze-for-typing [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-cloze-for-typing
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.CardRenderingService/ExtractLatex
Request: anki.card_rendering.ExtractLatexRequest
Response: anki.card_rendering.ExtractLatexResponse
Request fields:
text: optional string
svg: optional bool
expand_clozes: optional bool
Usage:
anki_as_code api card-rendering extract-latex [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-latex
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering get-empty-cards
/anki.card_rendering.CardRenderingService/GetEmptyCards
Request: anki.generic.Empty
Response: anki.card_rendering.EmptyCardsReport
Usage:
anki_as_code api card-rendering get-empty-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-empty-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering html-to-text-line
/anki.card_rendering.CardRenderingService/HtmlToTextLine
Request: anki.card_rendering.HtmlToTextLineRequest
Response: anki.generic.String
Request fields:
text: optional string
preserve_media_filenames: optional bool
Usage:
anki_as_code api card-rendering html-to-text-line [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for html-to-text-line
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering render-existing-card
/anki.card_rendering.CardRenderingService/RenderExistingCard
Request: anki.card_rendering.RenderExistingCardRequest
Response: anki.card_rendering.RenderCardResponse
Request fields:
card_id: optional int64
browser: optional bool
partial_render: optional bool
Usage:
anki_as_code api card-rendering render-existing-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-existing-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering render-markdown
/anki.card_rendering.CardRenderingService/RenderMarkdown
Request: anki.card_rendering.RenderMarkdownRequest
Response: anki.generic.String
Request fields:
markdown: optional string
sanitize: optional bool
Usage:
anki_as_code api card-rendering render-markdown [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-markdown
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering render-uncommitted-card
/anki.card_rendering.CardRenderingService/RenderUncommittedCard
Request: anki.card_rendering.RenderUncommittedCardRequest
Response: anki.card_rendering.RenderCardResponse
Request fields:
note: optional anki.notes.Note
card_ord: optional uint32
template: optional anki.notetypes.Notetype.Template
fill_empty: optional bool
partial_render: optional bool
Usage:
anki_as_code api card-rendering render-uncommitted-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-uncommitted-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering render-uncommitted-card-legacy
/anki.card_rendering.CardRenderingService/RenderUncommittedCardLegacy
Request: anki.card_rendering.RenderUncommittedCardLegacyRequest
Response: anki.card_rendering.RenderCardResponse
Request fields:
note: optional anki.notes.Note
card_ord: optional uint32
template: optional bytes
fill_empty: optional bool
partial_render: optional bool
Usage:
anki_as_code api card-rendering render-uncommitted-card-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for render-uncommitted-card-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.card_rendering.CardRenderingService/StripAvTags
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api card-rendering strip-av-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for strip-av-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api card-rendering strip-html
/anki.card_rendering.CardRenderingService/StripHtml
Request: anki.card_rendering.StripHtmlRequest
Response: anki.generic.String
Request fields:
text: optional string
mode: optional anki.card_rendering.StripHtmlRequest.Mode
Usage:
anki_as_code api card-rendering strip-html [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for strip-html
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api cards
anki.cards.CardsService
Usage:
anki_as_code api cards [command]
Available Commands:
get-card /anki.cards.CardsService/GetCard
remove-cards /anki.cards.CardsService/RemoveCards
set-deck /anki.cards.CardsService/SetDeck
set-flag /anki.cards.CardsService/SetFlag
update-cards /anki.cards.CardsService/UpdateCards
Flags:
-h, --help help for cards
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api cards [command] --help" for more information about a command.
anki_as_code api cards get-card
/anki.cards.CardsService/GetCard
Request: anki.cards.CardId
Response: anki.cards.Card
Request fields:
cid: optional int64
Usage:
anki_as_code api cards get-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api cards remove-cards
/anki.cards.CardsService/RemoveCards
Request: anki.cards.RemoveCardsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
Usage:
anki_as_code api cards remove-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api cards set-deck
/anki.cards.CardsService/SetDeck
Request: anki.cards.SetDeckRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
deck_id: optional int64
Usage:
anki_as_code api cards set-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api cards set-flag
/anki.cards.CardsService/SetFlag
Request: anki.cards.SetFlagRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
flag: optional uint32
Usage:
anki_as_code api cards set-flag [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-flag
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api cards update-cards
/anki.cards.CardsService/UpdateCards
Request: anki.cards.UpdateCardsRequest
Response: anki.collection.OpChanges
Request fields:
cards: repeated anki.cards.Card
skip_undo_entry: optional bool
Usage:
anki_as_code api cards update-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection
anki.collection.CollectionService
Usage:
anki_as_code api collection [command]
Available Commands:
add-custom-undo-entry /anki.collection.CollectionService/AddCustomUndoEntry
check-database /anki.collection.CollectionService/CheckDatabase
get-custom-colours /anki.collection.CollectionService/GetCustomColours
get-undo-status /anki.collection.CollectionService/GetUndoStatus
latest-progress /anki.collection.CollectionService/LatestProgress
merge-undo-entries /anki.collection.CollectionService/MergeUndoEntries
redo /anki.collection.CollectionService/Redo
set-load-balancer-enabled /anki.collection.CollectionService/SetLoadBalancerEnabled
set-wants-abort /anki.collection.CollectionService/SetWantsAbort
undo /anki.collection.CollectionService/Undo
Flags:
-h, --help help for collection
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api collection [command] --help" for more information about a command.
anki_as_code api collection add-custom-undo-entry
/anki.collection.CollectionService/AddCustomUndoEntry
Request: anki.generic.String
Response: anki.generic.UInt32
Request fields:
val: optional string
Usage:
anki_as_code api collection add-custom-undo-entry [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-custom-undo-entry
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection check-database
/anki.collection.CollectionService/CheckDatabase
Request: anki.generic.Empty
Response: anki.collection.CheckDatabaseResponse
Usage:
anki_as_code api collection check-database [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for check-database
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection get-custom-colours
/anki.collection.CollectionService/GetCustomColours
Request: anki.generic.Empty
Response: anki.collection.GetCustomColoursResponse
Usage:
anki_as_code api collection get-custom-colours [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-custom-colours
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection get-undo-status
/anki.collection.CollectionService/GetUndoStatus
Request: anki.generic.Empty
Response: anki.collection.UndoStatus
Usage:
anki_as_code api collection get-undo-status [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-undo-status
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection latest-progress
/anki.collection.CollectionService/LatestProgress
Request: anki.generic.Empty
Response: anki.collection.Progress
Usage:
anki_as_code api collection latest-progress [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for latest-progress
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection merge-undo-entries
/anki.collection.CollectionService/MergeUndoEntries
Request: anki.generic.UInt32
Response: anki.collection.OpChanges
Request fields:
val: optional uint32
Usage:
anki_as_code api collection merge-undo-entries [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for merge-undo-entries
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection redo
/anki.collection.CollectionService/Redo
Request: anki.generic.Empty
Response: anki.collection.OpChangesAfterUndo
Usage:
anki_as_code api collection redo [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for redo
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection set-load-balancer-enabled
/anki.collection.CollectionService/SetLoadBalancerEnabled
Request: anki.generic.Bool
Response: anki.collection.OpChanges
Request fields:
val: optional bool
Usage:
anki_as_code api collection set-load-balancer-enabled [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-load-balancer-enabled
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection set-wants-abort
/anki.collection.CollectionService/SetWantsAbort
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api collection set-wants-abort [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-wants-abort
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api collection undo
/anki.collection.CollectionService/Undo
Request: anki.generic.Empty
Response: anki.collection.OpChangesAfterUndo
Usage:
anki_as_code api collection undo [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for undo
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config
anki.config.ConfigService
Usage:
anki_as_code api config [command]
Available Commands:
get-all-config /anki.config.ConfigService/GetAllConfig
get-config-bool /anki.config.ConfigService/GetConfigBool
get-config-json /anki.config.ConfigService/GetConfigJson
get-config-string /anki.config.ConfigService/GetConfigString
get-preferences /anki.config.ConfigService/GetPreferences
remove-config /anki.config.ConfigService/RemoveConfig
set-config-bool /anki.config.ConfigService/SetConfigBool
set-config-json /anki.config.ConfigService/SetConfigJson
set-config-json-no-undo /anki.config.ConfigService/SetConfigJsonNoUndo
set-config-string /anki.config.ConfigService/SetConfigString
set-preferences /anki.config.ConfigService/SetPreferences
Flags:
-h, --help help for config
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api config [command] --help" for more information about a command.
anki_as_code api config get-all-config
/anki.config.ConfigService/GetAllConfig
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api config get-all-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-all-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config get-config-bool
/anki.config.ConfigService/GetConfigBool
Request: anki.config.GetConfigBoolRequest
Response: anki.generic.Bool
Request fields:
key: optional anki.config.ConfigKey.Bool
Usage:
anki_as_code api config get-config-bool [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-config-bool
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config get-config-json
/anki.config.ConfigService/GetConfigJson
Request: anki.generic.String
Response: anki.generic.Json
Request fields:
val: optional string
Usage:
anki_as_code api config get-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config get-config-string
/anki.config.ConfigService/GetConfigString
Request: anki.config.GetConfigStringRequest
Response: anki.generic.String
Request fields:
key: optional anki.config.ConfigKey.String
Usage:
anki_as_code api config get-config-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-config-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config get-preferences
/anki.config.ConfigService/GetPreferences
Request: anki.generic.Empty
Response: anki.config.Preferences
Usage:
anki_as_code api config get-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config remove-config
/anki.config.ConfigService/RemoveConfig
Request: anki.generic.String
Response: anki.collection.OpChanges
Request fields:
val: optional string
Usage:
anki_as_code api config remove-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config set-config-bool
/anki.config.ConfigService/SetConfigBool
Request: anki.config.SetConfigBoolRequest
Response: anki.collection.OpChanges
Request fields:
key: optional anki.config.ConfigKey.Bool
value: optional bool
undoable: optional bool
Usage:
anki_as_code api config set-config-bool [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-bool
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config set-config-json
/anki.config.ConfigService/SetConfigJson
Request: anki.config.SetConfigJsonRequest
Response: anki.collection.OpChanges
Request fields:
key: optional string
value_json: optional bytes
undoable: optional bool
Usage:
anki_as_code api config set-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config set-config-json-no-undo
/anki.config.ConfigService/SetConfigJsonNoUndo
Request: anki.config.SetConfigJsonRequest
Response: anki.generic.Empty
Request fields:
key: optional string
value_json: optional bytes
undoable: optional bool
Usage:
anki_as_code api config set-config-json-no-undo [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-json-no-undo
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config set-config-string
/anki.config.ConfigService/SetConfigString
Request: anki.config.SetConfigStringRequest
Response: anki.collection.OpChanges
Request fields:
key: optional anki.config.ConfigKey.String
value: optional string
undoable: optional bool
Usage:
anki_as_code api config set-config-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-config-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api config set-preferences
/anki.config.ConfigService/SetPreferences
Request: anki.config.Preferences
Response: anki.collection.OpChanges
Request fields:
scheduling: optional anki.config.Preferences.Scheduling
reviewing: optional anki.config.Preferences.Reviewing
editing: optional anki.config.Preferences.Editing
backups: optional anki.config.Preferences.BackupLimits
Usage:
anki_as_code api config set-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config
anki.deck_config.DeckConfigService
Usage:
anki_as_code api deck-config [command]
Available Commands:
add-or-update-deck-config-legacy /anki.deck_config.DeckConfigService/AddOrUpdateDeckConfigLegacy
all-deck-config-legacy /anki.deck_config.DeckConfigService/AllDeckConfigLegacy
get-deck-config /anki.deck_config.DeckConfigService/GetDeckConfig
get-deck-config-legacy /anki.deck_config.DeckConfigService/GetDeckConfigLegacy
get-deck-configs-for-update /anki.deck_config.DeckConfigService/GetDeckConfigsForUpdate
get-ignored-before-count /anki.deck_config.DeckConfigService/GetIgnoredBeforeCount
get-retention-workload /anki.deck_config.DeckConfigService/GetRetentionWorkload
new-deck-config-legacy /anki.deck_config.DeckConfigService/NewDeckConfigLegacy
remove-deck-config /anki.deck_config.DeckConfigService/RemoveDeckConfig
update-deck-configs /anki.deck_config.DeckConfigService/UpdateDeckConfigs
Flags:
-h, --help help for deck-config
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api deck-config [command] --help" for more information about a command.
anki_as_code api deck-config add-or-update-deck-config-legacy
/anki.deck_config.DeckConfigService/AddOrUpdateDeckConfigLegacy
Request: anki.generic.Json
Response: anki.deck_config.DeckConfigId
Request fields:
json: optional bytes
Usage:
anki_as_code api deck-config add-or-update-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config all-deck-config-legacy
/anki.deck_config.DeckConfigService/AllDeckConfigLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api deck-config all-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config get-deck-config
/anki.deck_config.DeckConfigService/GetDeckConfig
Request: anki.deck_config.DeckConfigId
Response: anki.deck_config.DeckConfig
Request fields:
dcid: optional int64
Usage:
anki_as_code api deck-config get-deck-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config get-deck-config-legacy
/anki.deck_config.DeckConfigService/GetDeckConfigLegacy
Request: anki.deck_config.DeckConfigId
Response: anki.generic.Json
Request fields:
dcid: optional int64
Usage:
anki_as_code api deck-config get-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config get-deck-configs-for-update
/anki.deck_config.DeckConfigService/GetDeckConfigsForUpdate
Request: anki.decks.DeckId
Response: anki.deck_config.DeckConfigsForUpdate
Request fields:
did: optional int64
Usage:
anki_as_code api deck-config get-deck-configs-for-update [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-configs-for-update
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config get-ignored-before-count
/anki.deck_config.DeckConfigService/GetIgnoredBeforeCount
Request: anki.deck_config.GetIgnoredBeforeCountRequest
Response: anki.deck_config.GetIgnoredBeforeCountResponse
Request fields:
ignore_revlogs_before_date: optional string
search: optional string
Usage:
anki_as_code api deck-config get-ignored-before-count [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-ignored-before-count
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config get-retention-workload
/anki.deck_config.DeckConfigService/GetRetentionWorkload
Request: anki.deck_config.GetRetentionWorkloadRequest
Response: anki.deck_config.GetRetentionWorkloadResponse
Request fields:
w: repeated float
search: optional string
Usage:
anki_as_code api deck-config get-retention-workload [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-retention-workload
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config new-deck-config-legacy
/anki.deck_config.DeckConfigService/NewDeckConfigLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api deck-config new-deck-config-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-deck-config-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config remove-deck-config
/anki.deck_config.DeckConfigService/RemoveDeckConfig
Request: anki.deck_config.DeckConfigId
Response: anki.generic.Empty
Request fields:
dcid: optional int64
Usage:
anki_as_code api deck-config remove-deck-config [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-deck-config
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api deck-config update-deck-configs
/anki.deck_config.DeckConfigService/UpdateDeckConfigs
Request: anki.deck_config.UpdateDeckConfigsRequest
Response: anki.collection.OpChanges
Request fields:
target_deck_id: optional int64
configs: repeated anki.deck_config.DeckConfig
removed_config_ids: repeated int64
mode: optional anki.deck_config.UpdateDeckConfigsMode
card_state_customizer: optional string
limits: optional anki.deck_config.DeckConfigsForUpdate.CurrentDeck.Limits
new_cards_ignore_review_limit: optional bool
fsrs: optional bool
apply_all_parent_limits: optional bool
fsrs_reschedule: optional bool
fsrs_health_check: optional bool
Usage:
anki_as_code api deck-config update-deck-configs [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-deck-configs
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks
anki.decks.DecksService
Usage:
anki_as_code api decks [command]
Available Commands:
add-deck /anki.decks.DecksService/AddDeck
add-deck-legacy /anki.decks.DecksService/AddDeckLegacy
add-or-update-deck-legacy /anki.decks.DecksService/AddOrUpdateDeckLegacy
add-or-update-filtered-deck /anki.decks.DecksService/AddOrUpdateFilteredDeck
deck-tree /anki.decks.DecksService/DeckTree
deck-tree-legacy /anki.decks.DecksService/DeckTreeLegacy
filtered-deck-order-labels /anki.decks.DecksService/FilteredDeckOrderLabels
get-all-decks-legacy /anki.decks.DecksService/GetAllDecksLegacy
get-current-deck /anki.decks.DecksService/GetCurrentDeck
get-deck /anki.decks.DecksService/GetDeck
get-deck-and-child-names /anki.decks.DecksService/GetDeckAndChildNames
get-deck-id-by-name /anki.decks.DecksService/GetDeckIdByName
get-deck-legacy /anki.decks.DecksService/GetDeckLegacy
get-deck-names /anki.decks.DecksService/GetDeckNames
get-or-create-filtered-deck /anki.decks.DecksService/GetOrCreateFilteredDeck
new-deck /anki.decks.DecksService/NewDeck
new-deck-legacy /anki.decks.DecksService/NewDeckLegacy
remove-decks /anki.decks.DecksService/RemoveDecks
rename-deck /anki.decks.DecksService/RenameDeck
reparent-decks /anki.decks.DecksService/ReparentDecks
set-current-deck /anki.decks.DecksService/SetCurrentDeck
set-deck-collapsed /anki.decks.DecksService/SetDeckCollapsed
update-deck /anki.decks.DecksService/UpdateDeck
update-deck-legacy /anki.decks.DecksService/UpdateDeckLegacy
Flags:
-h, --help help for decks
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api decks [command] --help" for more information about a command.
anki_as_code api decks add-deck
/anki.decks.DecksService/AddDeck
Request: anki.decks.Deck
Response: anki.collection.OpChangesWithId
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional int32
common: optional anki.decks.Deck.Common
normal: optional anki.decks.Deck.Normal
filtered: optional anki.decks.Deck.Filtered
Usage:
anki_as_code api decks add-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks add-deck-legacy
/anki.decks.DecksService/AddDeckLegacy
Request: anki.generic.Json
Response: anki.collection.OpChangesWithId
Request fields:
json: optional bytes
Usage:
anki_as_code api decks add-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks add-or-update-deck-legacy
/anki.decks.DecksService/AddOrUpdateDeckLegacy
Request: anki.decks.AddOrUpdateDeckLegacyRequest
Response: anki.decks.DeckId
Request fields:
deck: optional bytes
preserve_usn_and_mtime: optional bool
Usage:
anki_as_code api decks add-or-update-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks add-or-update-filtered-deck
/anki.decks.DecksService/AddOrUpdateFilteredDeck
Request: anki.decks.FilteredDeckForUpdate
Response: anki.collection.OpChangesWithId
Request fields:
id: optional int64
name: optional string
config: optional anki.decks.Deck.Filtered
allow_empty: optional bool
Usage:
anki_as_code api decks add-or-update-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks deck-tree
/anki.decks.DecksService/DeckTree
Request: anki.decks.DeckTreeRequest
Response: anki.decks.DeckTreeNode
Request fields:
now: optional int64
Usage:
anki_as_code api decks deck-tree [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-tree
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks deck-tree-legacy
/anki.decks.DecksService/DeckTreeLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api decks deck-tree-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-tree-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks filtered-deck-order-labels
/anki.decks.DecksService/FilteredDeckOrderLabels
Request: anki.generic.Empty
Response: anki.generic.StringList
Usage:
anki_as_code api decks filtered-deck-order-labels [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for filtered-deck-order-labels
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-all-decks-legacy
/anki.decks.DecksService/GetAllDecksLegacy
Request: anki.generic.Empty
Response: anki.generic.Json
Usage:
anki_as_code api decks get-all-decks-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-all-decks-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-current-deck
/anki.decks.DecksService/GetCurrentDeck
Request: anki.generic.Empty
Response: anki.decks.Deck
Usage:
anki_as_code api decks get-current-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-current-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-deck
/anki.decks.DecksService/GetDeck
Request: anki.decks.DeckId
Response: anki.decks.Deck
Request fields:
did: optional int64
Usage:
anki_as_code api decks get-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-deck-and-child-names
/anki.decks.DecksService/GetDeckAndChildNames
Request: anki.decks.DeckId
Response: anki.decks.DeckNames
Request fields:
did: optional int64
Usage:
anki_as_code api decks get-deck-and-child-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-and-child-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-deck-id-by-name
/anki.decks.DecksService/GetDeckIdByName
Request: anki.generic.String
Response: anki.decks.DeckId
Request fields:
val: optional string
Usage:
anki_as_code api decks get-deck-id-by-name [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-id-by-name
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-deck-legacy
/anki.decks.DecksService/GetDeckLegacy
Request: anki.decks.DeckId
Response: anki.generic.Json
Request fields:
did: optional int64
Usage:
anki_as_code api decks get-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-deck-names
/anki.decks.DecksService/GetDeckNames
Request: anki.decks.GetDeckNamesRequest
Response: anki.decks.DeckNames
Request fields:
skip_empty_default: optional bool
include_filtered: optional bool
Usage:
anki_as_code api decks get-deck-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-deck-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks get-or-create-filtered-deck
/anki.decks.DecksService/GetOrCreateFilteredDeck
Request: anki.decks.DeckId
Response: anki.decks.FilteredDeckForUpdate
Request fields:
did: optional int64
Usage:
anki_as_code api decks get-or-create-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-or-create-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks new-deck
/anki.decks.DecksService/NewDeck
Request: anki.generic.Empty
Response: anki.decks.Deck
Usage:
anki_as_code api decks new-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks new-deck-legacy
/anki.decks.DecksService/NewDeckLegacy
Request: anki.generic.Bool
Response: anki.generic.Json
Request fields:
val: optional bool
Usage:
anki_as_code api decks new-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks remove-decks
/anki.decks.DecksService/RemoveDecks
Request: anki.decks.DeckIds
Response: anki.collection.OpChangesWithCount
Request fields:
dids: repeated int64
Usage:
anki_as_code api decks remove-decks [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-decks
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks rename-deck
/anki.decks.DecksService/RenameDeck
Request: anki.decks.RenameDeckRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
new_name: optional string
Usage:
anki_as_code api decks rename-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for rename-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks reparent-decks
/anki.decks.DecksService/ReparentDecks
Request: anki.decks.ReparentDecksRequest
Response: anki.collection.OpChangesWithCount
Request fields:
deck_ids: repeated int64
new_parent: optional int64
Usage:
anki_as_code api decks reparent-decks [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for reparent-decks
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks set-current-deck
/anki.decks.DecksService/SetCurrentDeck
Request: anki.decks.DeckId
Response: anki.collection.OpChanges
Request fields:
did: optional int64
Usage:
anki_as_code api decks set-current-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-current-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks set-deck-collapsed
/anki.decks.DecksService/SetDeckCollapsed
Request: anki.decks.SetDeckCollapsedRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
collapsed: optional bool
scope: optional anki.decks.SetDeckCollapsedRequest.Scope
Usage:
anki_as_code api decks set-deck-collapsed [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-deck-collapsed
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks update-deck
/anki.decks.DecksService/UpdateDeck
Request: anki.decks.Deck
Response: anki.collection.OpChanges
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional int32
common: optional anki.decks.Deck.Common
normal: optional anki.decks.Deck.Normal
filtered: optional anki.decks.Deck.Filtered
Usage:
anki_as_code api decks update-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api decks update-deck-legacy
/anki.decks.DecksService/UpdateDeckLegacy
Request: anki.generic.Json
Response: anki.collection.OpChanges
Request fields:
json: optional bytes
Usage:
anki_as_code api decks update-deck-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-deck-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend
anki.frontend.FrontendService
Usage:
anki_as_code api frontend [command]
Available Commands:
ask-user /anki.frontend.FrontendService/AskUser
close-add-cards /anki.frontend.FrontendService/CloseAddCards
close-edit-current /anki.frontend.FrontendService/CloseEditCurrent
convert-pasted-image /anki.frontend.FrontendService/ConvertPastedImage
deck-options-ready /anki.frontend.FrontendService/deckOptionsReady
deck-options-require-close /anki.frontend.FrontendService/deckOptionsRequireClose
get-meta-json /anki.frontend.FrontendService/GetMetaJson
get-profile-config-json /anki.frontend.FrontendService/GetProfileConfigJson
get-scheduling-states-with-context /anki.frontend.FrontendService/GetSchedulingStatesWithContext
import-dialog-require-close /anki.frontend.FrontendService/ImportDialogRequireClose
import-done /anki.frontend.FrontendService/ImportDone
open-cards-dialog /anki.frontend.FrontendService/OpenCardsDialog
open-fields-dialog /anki.frontend.FrontendService/OpenFieldsDialog
open-file-picker /anki.frontend.FrontendService/OpenFilePicker
open-link /anki.frontend.FrontendService/OpenLink
open-media /anki.frontend.FrontendService/OpenMedia
play-file /anki.frontend.FrontendService/PlayFile
read-clipboard /anki.frontend.FrontendService/ReadClipboard
record-audio /anki.frontend.FrontendService/RecordAudio
save-custom-colours /anki.frontend.FrontendService/SaveCustomColours
search-in-browser /anki.frontend.FrontendService/SearchInBrowser
set-meta-json /anki.frontend.FrontendService/SetMetaJson
set-profile-config-json /anki.frontend.FrontendService/SetProfileConfigJson
set-scheduling-states /anki.frontend.FrontendService/SetSchedulingStates
show-in-media-folder /anki.frontend.FrontendService/ShowInMediaFolder
show-message-box /anki.frontend.FrontendService/ShowMessageBox
write-clipboard /anki.frontend.FrontendService/WriteClipboard
Flags:
-h, --help help for frontend
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api frontend [command] --help" for more information about a command.
anki_as_code api frontend ask-user
/anki.frontend.FrontendService/AskUser
Request: anki.frontend.AskUserRequest
Response: anki.generic.Bool
Request fields:
text: optional string
help: optional anki.frontend.Help
title: optional string
default_no: optional bool
Usage:
anki_as_code api frontend ask-user [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for ask-user
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend close-add-cards
/anki.frontend.FrontendService/CloseAddCards
Request: anki.generic.Bool
Response: anki.generic.Empty
Request fields:
val: optional bool
Usage:
anki_as_code api frontend close-add-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for close-add-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend close-edit-current
/anki.frontend.FrontendService/CloseEditCurrent
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend close-edit-current [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for close-edit-current
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend convert-pasted-image
/anki.frontend.FrontendService/ConvertPastedImage
Request: anki.frontend.ConvertPastedImageRequest
Response: anki.frontend.ConvertPastedImageResponse
Request fields:
data: optional bytes
ext: optional string
Usage:
anki_as_code api frontend convert-pasted-image [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for convert-pasted-image
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend deck-options-ready
/anki.frontend.FrontendService/deckOptionsReady
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend deck-options-ready [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-options-ready
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend deck-options-require-close
/anki.frontend.FrontendService/deckOptionsRequireClose
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend deck-options-require-close [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for deck-options-require-close
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.FrontendService/GetMetaJson
Request: anki.generic.String
Response: anki.generic.Json
Request fields:
val: optional string
Usage:
anki_as_code api frontend get-meta-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-meta-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend get-profile-config-json
/anki.frontend.FrontendService/GetProfileConfigJson
Request: anki.generic.String
Response: anki.generic.Json
Request fields:
val: optional string
Usage:
anki_as_code api frontend get-profile-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-profile-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend get-scheduling-states-with-context
/anki.frontend.FrontendService/GetSchedulingStatesWithContext
Request: anki.generic.Empty
Response: anki.frontend.SchedulingStatesWithContext
Usage:
anki_as_code api frontend get-scheduling-states-with-context [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-scheduling-states-with-context
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend import-dialog-require-close
/anki.frontend.FrontendService/ImportDialogRequireClose
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend import-dialog-require-close [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-dialog-require-close
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend import-done
/anki.frontend.FrontendService/ImportDone
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend import-done [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-done
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend open-cards-dialog
/anki.frontend.FrontendService/OpenCardsDialog
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend open-cards-dialog [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-cards-dialog
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend open-fields-dialog
/anki.frontend.FrontendService/OpenFieldsDialog
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend open-fields-dialog [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-fields-dialog
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend open-file-picker
/anki.frontend.FrontendService/OpenFilePicker
Request: anki.frontend.openFilePickerRequest
Response: anki.generic.String
Request fields:
title: optional string
key: optional string
filter_description: optional string
extensions: repeated string
Usage:
anki_as_code api frontend open-file-picker [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-file-picker
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend open-link
/anki.frontend.FrontendService/OpenLink
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api frontend open-link [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-link
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.FrontendService/OpenMedia
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api frontend open-media [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for open-media
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend play-file
/anki.frontend.FrontendService/PlayFile
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api frontend play-file [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for play-file
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend read-clipboard
/anki.frontend.FrontendService/ReadClipboard
Request: anki.frontend.ReadClipboardRequest
Response: anki.frontend.ReadClipboardResponse
Request fields:
types: repeated string
Usage:
anki_as_code api frontend read-clipboard [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for read-clipboard
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend record-audio
/anki.frontend.FrontendService/RecordAudio
Request: anki.generic.Empty
Response: anki.generic.String
Usage:
anki_as_code api frontend record-audio [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for record-audio
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend save-custom-colours
/anki.frontend.FrontendService/SaveCustomColours
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api frontend save-custom-colours [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for save-custom-colours
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend search-in-browser
/anki.frontend.FrontendService/SearchInBrowser
Request: anki.search.SearchNode
Response: anki.generic.Empty
Request fields:
group: optional anki.search.SearchNode.Group
negated: optional anki.search.SearchNode
parsable_text: optional string
template: optional uint32
nid: optional int64
dupe: optional anki.search.SearchNode.Dupe
field_name: optional string
rated: optional anki.search.SearchNode.Rated
added_in_days: optional uint32
due_in_days: optional int32
flag: optional anki.search.SearchNode.Flag
card_state: optional anki.search.SearchNode.CardState
nids: optional anki.search.SearchNode.IdList
edited_in_days: optional uint32
deck: optional string
due_on_day: optional int32
tag: optional string
note: optional string
introduced_in_days: optional uint32
field: optional anki.search.SearchNode.Field
literal_text: optional string
Usage:
anki_as_code api frontend search-in-browser [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for search-in-browser
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.FrontendService/SetMetaJson
Request: anki.frontend.SetSettingJsonRequest
Response: anki.generic.Empty
Request fields:
key: optional string
value_json: optional bytes
Usage:
anki_as_code api frontend set-meta-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-meta-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend set-profile-config-json
/anki.frontend.FrontendService/SetProfileConfigJson
Request: anki.frontend.SetSettingJsonRequest
Response: anki.generic.Empty
Request fields:
key: optional string
value_json: optional bytes
Usage:
anki_as_code api frontend set-profile-config-json [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-profile-config-json
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend set-scheduling-states
/anki.frontend.FrontendService/SetSchedulingStates
Request: anki.frontend.SetSchedulingStatesRequest
Response: anki.generic.Empty
Request fields:
key: optional string
states: optional anki.scheduler.SchedulingStates
Usage:
anki_as_code api frontend set-scheduling-states [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-scheduling-states
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.frontend.FrontendService/ShowInMediaFolder
Request: anki.generic.String
Response: anki.generic.Empty
Request fields:
val: optional string
Usage:
anki_as_code api frontend show-in-media-folder [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for show-in-media-folder
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend show-message-box
/anki.frontend.FrontendService/ShowMessageBox
Request: anki.frontend.ShowMessageBoxRequest
Response: anki.generic.Empty
Request fields:
text: optional string
type: optional anki.frontend.MessageBoxType
help: optional anki.frontend.Help
title: optional string
text_format: optional string
Usage:
anki_as_code api frontend show-message-box [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for show-message-box
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api frontend write-clipboard
/anki.frontend.FrontendService/WriteClipboard
Request: anki.frontend.WriteClipboardRequest
Response: anki.generic.Empty
Request fields:
data: repeated anki.frontend.WriteClipboardRequest.DataEntry
Usage:
anki_as_code api frontend write-clipboard [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for write-clipboard
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api github
anki.github.GithubService
anki_as_code api i18n
anki.i18n.I18nService
Usage:
anki_as_code api i18n [command]
Available Commands:
format-timespan /anki.i18n.I18nService/FormatTimespan
i18n-resources /anki.i18n.I18nService/I18nResources
translate-string /anki.i18n.I18nService/TranslateString
Flags:
-h, --help help for i18n
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api i18n [command] --help" for more information about a command.
/anki.i18n.I18nService/FormatTimespan
Request: anki.i18n.FormatTimespanRequest
Response: anki.generic.String
Request fields:
seconds: optional float
context: optional anki.i18n.FormatTimespanRequest.Context
Usage:
anki_as_code api i18n format-timespan [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for format-timespan
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api i18n i18n-resources
/anki.i18n.I18nService/I18nResources
Request: anki.i18n.I18nResourcesRequest
Response: anki.generic.Json
Request fields:
modules: repeated string
Usage:
anki_as_code api i18n i18n-resources [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for i18n-resources
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api i18n translate-string
/anki.i18n.I18nService/TranslateString
Request: anki.i18n.TranslateStringRequest
Response: anki.generic.String
Request fields:
module_index: optional uint32
message_index: optional uint32
args: repeated anki.i18n.TranslateStringRequest.ArgsEntry
Usage:
anki_as_code api i18n translate-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for translate-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api image-occlusion
anki.image_occlusion.ImageOcclusionService
Usage:
anki_as_code api image-occlusion [command]
Available Commands:
add-image-occlusion-note /anki.image_occlusion.ImageOcclusionService/AddImageOcclusionNote
add-image-occlusion-notetype /anki.image_occlusion.ImageOcclusionService/AddImageOcclusionNotetype
get-image-for-occlusion /anki.image_occlusion.ImageOcclusionService/GetImageForOcclusion
get-image-occlusion-fields /anki.image_occlusion.ImageOcclusionService/GetImageOcclusionFields
get-image-occlusion-note /anki.image_occlusion.ImageOcclusionService/GetImageOcclusionNote
update-image-occlusion-note /anki.image_occlusion.ImageOcclusionService/UpdateImageOcclusionNote
Flags:
-h, --help help for image-occlusion
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api image-occlusion [command] --help" for more information about a command.
anki_as_code api image-occlusion add-image-occlusion-note
/anki.image_occlusion.ImageOcclusionService/AddImageOcclusionNote
Request: anki.image_occlusion.AddImageOcclusionNoteRequest
Response: anki.collection.OpChanges
Request fields:
image_path: optional string
occlusions: optional string
header: optional string
back_extra: optional string
tags: repeated string
notetype_id: optional int64
Usage:
anki_as_code api image-occlusion add-image-occlusion-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-image-occlusion-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api image-occlusion add-image-occlusion-notetype
/anki.image_occlusion.ImageOcclusionService/AddImageOcclusionNotetype
Request: anki.generic.Empty
Response: anki.collection.OpChanges
Usage:
anki_as_code api image-occlusion add-image-occlusion-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-image-occlusion-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api image-occlusion get-image-for-occlusion
/anki.image_occlusion.ImageOcclusionService/GetImageForOcclusion
Request: anki.image_occlusion.GetImageForOcclusionRequest
Response: anki.image_occlusion.GetImageForOcclusionResponse
Request fields:
path: optional string
Usage:
anki_as_code api image-occlusion get-image-for-occlusion [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-image-for-occlusion
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api image-occlusion get-image-occlusion-fields
/anki.image_occlusion.ImageOcclusionService/GetImageOcclusionFields
Request: anki.image_occlusion.GetImageOcclusionFieldsRequest
Response: anki.image_occlusion.GetImageOcclusionFieldsResponse
Request fields:
notetype_id: optional int64
Usage:
anki_as_code api image-occlusion get-image-occlusion-fields [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-image-occlusion-fields
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api image-occlusion get-image-occlusion-note
/anki.image_occlusion.ImageOcclusionService/GetImageOcclusionNote
Request: anki.image_occlusion.GetImageOcclusionNoteRequest
Response: anki.image_occlusion.GetImageOcclusionNoteResponse
Request fields:
note_id: optional int64
Usage:
anki_as_code api image-occlusion get-image-occlusion-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-image-occlusion-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api image-occlusion update-image-occlusion-note
/anki.image_occlusion.ImageOcclusionService/UpdateImageOcclusionNote
Request: anki.image_occlusion.UpdateImageOcclusionNoteRequest
Response: anki.collection.OpChanges
Request fields:
note_id: optional int64
occlusions: optional string
header: optional string
back_extra: optional string
tags: repeated string
Usage:
anki_as_code api image-occlusion update-image-occlusion-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-image-occlusion-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export
anki.import_export.ImportExportService
Usage:
anki_as_code api import-export [command]
Available Commands:
export-anki-package /anki.import_export.ImportExportService/ExportAnkiPackage
export-card-csv /anki.import_export.ImportExportService/ExportCardCsv
export-note-csv /anki.import_export.ImportExportService/ExportNoteCsv
get-csv-metadata /anki.import_export.ImportExportService/GetCsvMetadata
get-import-anki-package-presets /anki.import_export.ImportExportService/GetImportAnkiPackagePresets
import-anki-package /anki.import_export.ImportExportService/ImportAnkiPackage
import-csv /anki.import_export.ImportExportService/ImportCsv
import-json-file /anki.import_export.ImportExportService/ImportJsonFile
import-json-string /anki.import_export.ImportExportService/ImportJsonString
Flags:
-h, --help help for import-export
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api import-export [command] --help" for more information about a command.
anki_as_code api import-export export-anki-package
/anki.import_export.ImportExportService/ExportAnkiPackage
Request: anki.import_export.ExportAnkiPackageRequest
Response: anki.generic.UInt32
Request fields:
out_path: optional string
options: optional anki.import_export.ExportAnkiPackageOptions
limit: optional anki.import_export.ExportLimit
Usage:
anki_as_code api import-export export-anki-package [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-anki-package
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export export-card-csv
/anki.import_export.ImportExportService/ExportCardCsv
Request: anki.import_export.ExportCardCsvRequest
Response: anki.generic.UInt32
Request fields:
out_path: optional string
with_html: optional bool
limit: optional anki.import_export.ExportLimit
Usage:
anki_as_code api import-export export-card-csv [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-card-csv
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export export-note-csv
/anki.import_export.ImportExportService/ExportNoteCsv
Request: anki.import_export.ExportNoteCsvRequest
Response: anki.generic.UInt32
Request fields:
out_path: optional string
with_html: optional bool
with_tags: optional bool
with_deck: optional bool
with_notetype: optional bool
with_guid: optional bool
limit: optional anki.import_export.ExportLimit
Usage:
anki_as_code api import-export export-note-csv [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for export-note-csv
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.import_export.ImportExportService/GetCsvMetadata
Request: anki.import_export.CsvMetadataRequest
Response: anki.import_export.CsvMetadata
Request fields:
path: optional string
delimiter: optional anki.import_export.CsvMetadata.Delimiter
notetype_id: optional int64
deck_id: optional int64
is_html: optional bool
Usage:
anki_as_code api import-export get-csv-metadata [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-csv-metadata
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export get-import-anki-package-presets
/anki.import_export.ImportExportService/GetImportAnkiPackagePresets
Request: anki.generic.Empty
Response: anki.import_export.ImportAnkiPackageOptions
Usage:
anki_as_code api import-export get-import-anki-package-presets [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-import-anki-package-presets
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export import-anki-package
/anki.import_export.ImportExportService/ImportAnkiPackage
Request: anki.import_export.ImportAnkiPackageRequest
Response: anki.import_export.ImportResponse
Request fields:
package_path: optional string
options: optional anki.import_export.ImportAnkiPackageOptions
Usage:
anki_as_code api import-export import-anki-package [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-anki-package
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export import-csv
/anki.import_export.ImportExportService/ImportCsv
Request: anki.import_export.ImportCsvRequest
Response: anki.import_export.ImportResponse
Request fields:
path: optional string
metadata: optional anki.import_export.CsvMetadata
Usage:
anki_as_code api import-export import-csv [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-csv
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export import-json-file
/anki.import_export.ImportExportService/ImportJsonFile
Request: anki.generic.String
Response: anki.import_export.ImportResponse
Request fields:
val: optional string
Usage:
anki_as_code api import-export import-json-file [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-json-file
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api import-export import-json-string
/anki.import_export.ImportExportService/ImportJsonString
Request: anki.generic.String
Response: anki.import_export.ImportResponse
Request fields:
val: optional string
Usage:
anki_as_code api import-export import-json-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for import-json-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api links
anki.links.LinksService
Usage:
anki_as_code api links [command]
Available Commands:
help-page-link /anki.links.LinksService/HelpPageLink
Flags:
-h, --help help for links
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api links [command] --help" for more information about a command.
anki_as_code api links help-page-link
/anki.links.LinksService/HelpPageLink
Request: anki.links.HelpPageLinkRequest
Response: anki.generic.String
Request fields:
page: optional anki.links.HelpPageLinkRequest.HelpPage
Usage:
anki_as_code api links help-page-link [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for help-page-link
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki.media.MediaService
Usage:
anki_as_code api media [command]
Available Commands:
add-media-file /anki.media.MediaService/AddMediaFile
add-media-from-path /anki.media.MediaService/AddMediaFromPath
check-media /anki.media.MediaService/CheckMedia
empty-trash /anki.media.MediaService/EmptyTrash
extract-media-files /anki.media.MediaService/ExtractMediaFiles
extract-static-media-files /anki.media.MediaService/ExtractStaticMediaFiles
get-absolute-media-path /anki.media.MediaService/GetAbsoluteMediaPath
restore-trash /anki.media.MediaService/RestoreTrash
trash-media-files /anki.media.MediaService/TrashMediaFiles
Flags:
-h, --help help for media
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api media [command] --help" for more information about a command.
/anki.media.MediaService/AddMediaFile
Request: anki.media.AddMediaFileRequest
Response: anki.generic.String
Request fields:
desired_name: optional string
data: optional bytes
Usage:
anki_as_code api media add-media-file [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-media-file
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/AddMediaFromPath
Request: anki.media.AddMediaFromPathRequest
Response: anki.generic.String
Request fields:
path: optional string
Usage:
anki_as_code api media add-media-from-path [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-media-from-path
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/CheckMedia
Request: anki.generic.Empty
Response: anki.media.CheckMediaResponse
Usage:
anki_as_code api media check-media [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for check-media
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/EmptyTrash
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api media empty-trash [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for empty-trash
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/ExtractMediaFiles
Request: anki.generic.String
Response: anki.generic.StringList
Request fields:
val: optional string
Usage:
anki_as_code api media extract-media-files [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-media-files
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/ExtractStaticMediaFiles
Request: anki.notetypes.NotetypeId
Response: anki.generic.StringList
Request fields:
ntid: optional int64
Usage:
anki_as_code api media extract-static-media-files [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extract-static-media-files
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/GetAbsoluteMediaPath
Request: anki.generic.String
Response: anki.generic.String
Request fields:
val: optional string
Usage:
anki_as_code api media get-absolute-media-path [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-absolute-media-path
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/RestoreTrash
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api media restore-trash [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for restore-trash
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.media.MediaService/TrashMediaFiles
Request: anki.media.TrashMediaFilesRequest
Response: anki.generic.Empty
Request fields:
fnames: repeated string
Usage:
anki_as_code api media trash-media-files [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for trash-media-files
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes
anki.notes.NotesService
Usage:
anki_as_code api notes [command]
Available Commands:
add-note /anki.notes.NotesService/AddNote
add-notes /anki.notes.NotesService/AddNotes
after-note-updates /anki.notes.NotesService/AfterNoteUpdates
cards-of-note /anki.notes.NotesService/CardsOfNote
cloze-numbers-in-note /anki.notes.NotesService/ClozeNumbersInNote
default-deck-for-notetype /anki.notes.NotesService/DefaultDeckForNotetype
defaults-for-adding /anki.notes.NotesService/DefaultsForAdding
field-names-for-notes /anki.notes.NotesService/FieldNamesForNotes
get-note /anki.notes.NotesService/GetNote
get-single-notetype-of-notes /anki.notes.NotesService/GetSingleNotetypeOfNotes
new-note /anki.notes.NotesService/NewNote
note-fields-check /anki.notes.NotesService/NoteFieldsCheck
remove-notes /anki.notes.NotesService/RemoveNotes
update-notes /anki.notes.NotesService/UpdateNotes
Flags:
-h, --help help for notes
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api notes [command] --help" for more information about a command.
anki_as_code api notes add-note
/anki.notes.NotesService/AddNote
Request: anki.notes.AddNoteRequest
Response: anki.notes.AddNoteResponse
Request fields:
note: optional anki.notes.Note
deck_id: optional int64
Usage:
anki_as_code api notes add-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes add-notes
/anki.notes.NotesService/AddNotes
Request: anki.notes.AddNotesRequest
Response: anki.notes.AddNotesResponse
Request fields:
requests: repeated anki.notes.AddNoteRequest
Usage:
anki_as_code api notes add-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes after-note-updates
/anki.notes.NotesService/AfterNoteUpdates
Request: anki.notes.AfterNoteUpdatesRequest
Response: anki.collection.OpChangesWithCount
Request fields:
nids: repeated int64
mark_notes_modified: optional bool
generate_cards: optional bool
Usage:
anki_as_code api notes after-note-updates [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for after-note-updates
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes cards-of-note
/anki.notes.NotesService/CardsOfNote
Request: anki.notes.NoteId
Response: anki.cards.CardIds
Request fields:
nid: optional int64
Usage:
anki_as_code api notes cards-of-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for cards-of-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes cloze-numbers-in-note
/anki.notes.NotesService/ClozeNumbersInNote
Request: anki.notes.Note
Response: anki.notes.ClozeNumbersInNoteResponse
Request fields:
id: optional int64
guid: optional string
notetype_id: optional int64
mtime_secs: optional uint32
usn: optional int32
tags: repeated string
fields: repeated string
Usage:
anki_as_code api notes cloze-numbers-in-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for cloze-numbers-in-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes default-deck-for-notetype
/anki.notes.NotesService/DefaultDeckForNotetype
Request: anki.notetypes.NotetypeId
Response: anki.decks.DeckId
Request fields:
ntid: optional int64
Usage:
anki_as_code api notes default-deck-for-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for default-deck-for-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes defaults-for-adding
/anki.notes.NotesService/DefaultsForAdding
Request: anki.notes.DefaultsForAddingRequest
Response: anki.notes.DeckAndNotetype
Request fields:
home_deck_of_current_review_card: optional int64
Usage:
anki_as_code api notes defaults-for-adding [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for defaults-for-adding
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes field-names-for-notes
/anki.notes.NotesService/FieldNamesForNotes
Request: anki.notes.FieldNamesForNotesRequest
Response: anki.notes.FieldNamesForNotesResponse
Request fields:
nids: repeated int64
Usage:
anki_as_code api notes field-names-for-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for field-names-for-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes get-note
/anki.notes.NotesService/GetNote
Request: anki.notes.NoteId
Response: anki.notes.Note
Request fields:
nid: optional int64
Usage:
anki_as_code api notes get-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes get-single-notetype-of-notes
/anki.notes.NotesService/GetSingleNotetypeOfNotes
Request: anki.notes.NoteIds
Response: anki.notetypes.NotetypeId
Request fields:
note_ids: repeated int64
Usage:
anki_as_code api notes get-single-notetype-of-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-single-notetype-of-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes new-note
/anki.notes.NotesService/NewNote
Request: anki.notetypes.NotetypeId
Response: anki.notes.Note
Request fields:
ntid: optional int64
Usage:
anki_as_code api notes new-note [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for new-note
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes note-fields-check
/anki.notes.NotesService/NoteFieldsCheck
Request: anki.notes.Note
Response: anki.notes.NoteFieldsCheckResponse
Request fields:
id: optional int64
guid: optional string
notetype_id: optional int64
mtime_secs: optional uint32
usn: optional int32
tags: repeated string
fields: repeated string
Usage:
anki_as_code api notes note-fields-check [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for note-fields-check
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes remove-notes
/anki.notes.NotesService/RemoveNotes
Request: anki.notes.RemoveNotesRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
card_ids: repeated int64
Usage:
anki_as_code api notes remove-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notes update-notes
/anki.notes.NotesService/UpdateNotes
Request: anki.notes.UpdateNotesRequest
Response: anki.collection.OpChanges
Request fields:
notes: repeated anki.notes.Note
skip_undo_entry: optional bool
Usage:
anki_as_code api notes update-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes
anki.notetypes.NotetypesService
Usage:
anki_as_code api notetypes [command]
Available Commands:
add-notetype /anki.notetypes.NotetypesService/AddNotetype
add-notetype-legacy /anki.notetypes.NotetypesService/AddNotetypeLegacy
add-or-update-notetype /anki.notetypes.NotetypesService/AddOrUpdateNotetype
change-notetype /anki.notetypes.NotetypesService/ChangeNotetype
get-aux-notetype-config-key /anki.notetypes.NotetypesService/GetAuxNotetypeConfigKey
get-aux-template-config-key /anki.notetypes.NotetypesService/GetAuxTemplateConfigKey
get-change-notetype-info /anki.notetypes.NotetypesService/GetChangeNotetypeInfo
get-cloze-field-ords /anki.notetypes.NotetypesService/GetClozeFieldOrds
get-field-names /anki.notetypes.NotetypesService/GetFieldNames
get-notetype /anki.notetypes.NotetypesService/GetNotetype
get-notetype-id-by-name /anki.notetypes.NotetypesService/GetNotetypeIdByName
get-notetype-legacy /anki.notetypes.NotetypesService/GetNotetypeLegacy
get-notetype-names /anki.notetypes.NotetypesService/GetNotetypeNames
get-notetype-names-and-counts /anki.notetypes.NotetypesService/GetNotetypeNamesAndCounts
get-stock-notetype-legacy /anki.notetypes.NotetypesService/GetStockNotetypeLegacy
remove-notetype /anki.notetypes.NotetypesService/RemoveNotetype
restore-notetype-to-stock /anki.notetypes.NotetypesService/RestoreNotetypeToStock
update-notetype /anki.notetypes.NotetypesService/UpdateNotetype
update-notetype-legacy /anki.notetypes.NotetypesService/UpdateNotetypeLegacy
Flags:
-h, --help help for notetypes
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api notetypes [command] --help" for more information about a command.
anki_as_code api notetypes add-notetype
/anki.notetypes.NotetypesService/AddNotetype
Request: anki.notetypes.Notetype
Response: anki.collection.OpChangesWithId
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional sint32
config: optional anki.notetypes.Notetype.Config
fields: repeated anki.notetypes.Notetype.Field
templates: repeated anki.notetypes.Notetype.Template
Usage:
anki_as_code api notetypes add-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes add-notetype-legacy
/anki.notetypes.NotetypesService/AddNotetypeLegacy
Request: anki.generic.Json
Response: anki.collection.OpChangesWithId
Request fields:
json: optional bytes
Usage:
anki_as_code api notetypes add-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes add-or-update-notetype
/anki.notetypes.NotetypesService/AddOrUpdateNotetype
Request: anki.notetypes.AddOrUpdateNotetypeRequest
Response: anki.notetypes.NotetypeId
Request fields:
json: optional bytes
preserve_usn_and_mtime: optional bool
skip_checks: optional bool
Usage:
anki_as_code api notetypes add-or-update-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-or-update-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes change-notetype
/anki.notetypes.NotetypesService/ChangeNotetype
Request: anki.notetypes.ChangeNotetypeRequest
Response: anki.collection.OpChanges
Request fields:
note_ids: repeated int64
new_fields: repeated int32
new_templates: repeated int32
old_notetype_id: optional int64
new_notetype_id: optional int64
current_schema: optional int64
old_notetype_name: optional string
is_cloze: optional bool
Usage:
anki_as_code api notetypes change-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for change-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-aux-notetype-config-key
/anki.notetypes.NotetypesService/GetAuxNotetypeConfigKey
Request: anki.notetypes.GetAuxConfigKeyRequest
Response: anki.generic.String
Request fields:
id: optional int64
key: optional string
Usage:
anki_as_code api notetypes get-aux-notetype-config-key [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-aux-notetype-config-key
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-aux-template-config-key
/anki.notetypes.NotetypesService/GetAuxTemplateConfigKey
Request: anki.notetypes.GetAuxTemplateConfigKeyRequest
Response: anki.generic.String
Request fields:
notetype_id: optional int64
card_ordinal: optional uint32
key: optional string
Usage:
anki_as_code api notetypes get-aux-template-config-key [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-aux-template-config-key
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-change-notetype-info
/anki.notetypes.NotetypesService/GetChangeNotetypeInfo
Request: anki.notetypes.GetChangeNotetypeInfoRequest
Response: anki.notetypes.ChangeNotetypeInfo
Request fields:
old_notetype_id: optional int64
new_notetype_id: optional int64
Usage:
anki_as_code api notetypes get-change-notetype-info [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-change-notetype-info
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-cloze-field-ords
/anki.notetypes.NotetypesService/GetClozeFieldOrds
Request: anki.notetypes.NotetypeId
Response: anki.notetypes.GetClozeFieldOrdsResponse
Request fields:
ntid: optional int64
Usage:
anki_as_code api notetypes get-cloze-field-ords [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-cloze-field-ords
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-field-names
/anki.notetypes.NotetypesService/GetFieldNames
Request: anki.notetypes.NotetypeId
Response: anki.generic.StringList
Request fields:
ntid: optional int64
Usage:
anki_as_code api notetypes get-field-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-field-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-notetype
/anki.notetypes.NotetypesService/GetNotetype
Request: anki.notetypes.NotetypeId
Response: anki.notetypes.Notetype
Request fields:
ntid: optional int64
Usage:
anki_as_code api notetypes get-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-notetype-id-by-name
/anki.notetypes.NotetypesService/GetNotetypeIdByName
Request: anki.generic.String
Response: anki.notetypes.NotetypeId
Request fields:
val: optional string
Usage:
anki_as_code api notetypes get-notetype-id-by-name [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-id-by-name
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-notetype-legacy
/anki.notetypes.NotetypesService/GetNotetypeLegacy
Request: anki.notetypes.NotetypeId
Response: anki.generic.Json
Request fields:
ntid: optional int64
Usage:
anki_as_code api notetypes get-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-notetype-names
/anki.notetypes.NotetypesService/GetNotetypeNames
Request: anki.generic.Empty
Response: anki.notetypes.NotetypeNames
Usage:
anki_as_code api notetypes get-notetype-names [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-names
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-notetype-names-and-counts
/anki.notetypes.NotetypesService/GetNotetypeNamesAndCounts
Request: anki.generic.Empty
Response: anki.notetypes.NotetypeUseCounts
Usage:
anki_as_code api notetypes get-notetype-names-and-counts [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-notetype-names-and-counts
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes get-stock-notetype-legacy
/anki.notetypes.NotetypesService/GetStockNotetypeLegacy
Request: anki.notetypes.StockNotetype
Response: anki.generic.Json
Request fields:
kind: optional anki.notetypes.StockNotetype.Kind
Usage:
anki_as_code api notetypes get-stock-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-stock-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes remove-notetype
/anki.notetypes.NotetypesService/RemoveNotetype
Request: anki.notetypes.NotetypeId
Response: anki.collection.OpChanges
Request fields:
ntid: optional int64
Usage:
anki_as_code api notetypes remove-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes restore-notetype-to-stock
/anki.notetypes.NotetypesService/RestoreNotetypeToStock
Request: anki.notetypes.RestoreNotetypeToStockRequest
Response: anki.collection.OpChanges
Request fields:
notetype_id: optional anki.notetypes.NotetypeId
force_kind: optional anki.notetypes.StockNotetype.Kind
Usage:
anki_as_code api notetypes restore-notetype-to-stock [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for restore-notetype-to-stock
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes update-notetype
/anki.notetypes.NotetypesService/UpdateNotetype
Request: anki.notetypes.Notetype
Response: anki.collection.OpChanges
Request fields:
id: optional int64
name: optional string
mtime_secs: optional int64
usn: optional sint32
config: optional anki.notetypes.Notetype.Config
fields: repeated anki.notetypes.Notetype.Field
templates: repeated anki.notetypes.Notetype.Template
Usage:
anki_as_code api notetypes update-notetype [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-notetype
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api notetypes update-notetype-legacy
/anki.notetypes.NotetypesService/UpdateNotetypeLegacy
Request: anki.notetypes.UpdateNotetypeLegacyRequest
Response: anki.collection.OpChanges
Request fields:
json: optional bytes
skip_checks: optional bool
Usage:
anki_as_code api notetypes update-notetype-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-notetype-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler
anki.scheduler.SchedulerService
Usage:
anki_as_code api scheduler [command]
Available Commands:
answer-card /anki.scheduler.SchedulerService/AnswerCard
bury-or-suspend-cards /anki.scheduler.SchedulerService/BuryOrSuspendCards
compute-fsrs-params /anki.scheduler.SchedulerService/ComputeFsrsParams
compute-memory-state /anki.scheduler.SchedulerService/ComputeMemoryState
compute-optimal-retention /anki.scheduler.SchedulerService/ComputeOptimalRetention
congrats-info /anki.scheduler.SchedulerService/CongratsInfo
counts-for-deck-today /anki.scheduler.SchedulerService/CountsForDeckToday
custom-study /anki.scheduler.SchedulerService/CustomStudy
custom-study-defaults /anki.scheduler.SchedulerService/CustomStudyDefaults
describe-next-states /anki.scheduler.SchedulerService/DescribeNextStates
empty-filtered-deck /anki.scheduler.SchedulerService/EmptyFilteredDeck
evaluate-params /anki.scheduler.SchedulerService/EvaluateParams
evaluate-params-legacy /anki.scheduler.SchedulerService/EvaluateParamsLegacy
extend-limits /anki.scheduler.SchedulerService/ExtendLimits
fuzz-delta /anki.scheduler.SchedulerService/FuzzDelta
get-optimal-retention-parameters /anki.scheduler.SchedulerService/GetOptimalRetentionParameters
get-queued-cards /anki.scheduler.SchedulerService/GetQueuedCards
get-scheduling-states /anki.scheduler.SchedulerService/GetSchedulingStates
grade-now /anki.scheduler.SchedulerService/GradeNow
rebuild-filtered-deck /anki.scheduler.SchedulerService/RebuildFilteredDeck
reposition-defaults /anki.scheduler.SchedulerService/RepositionDefaults
restore-buried-and-suspended-cards /anki.scheduler.SchedulerService/RestoreBuriedAndSuspendedCards
sched-timing-today /anki.scheduler.SchedulerService/SchedTimingToday
schedule-cards-as-new /anki.scheduler.SchedulerService/ScheduleCardsAsNew
schedule-cards-as-new-defaults /anki.scheduler.SchedulerService/ScheduleCardsAsNewDefaults
set-due-date /anki.scheduler.SchedulerService/SetDueDate
simulate-fsrs-review /anki.scheduler.SchedulerService/SimulateFsrsReview
simulate-fsrs-workload /anki.scheduler.SchedulerService/SimulateFsrsWorkload
sort-cards /anki.scheduler.SchedulerService/SortCards
sort-deck /anki.scheduler.SchedulerService/SortDeck
state-is-leech /anki.scheduler.SchedulerService/StateIsLeech
studied-today /anki.scheduler.SchedulerService/StudiedToday
studied-today-message /anki.scheduler.SchedulerService/StudiedTodayMessage
unbury-deck /anki.scheduler.SchedulerService/UnburyDeck
update-stats /anki.scheduler.SchedulerService/UpdateStats
upgrade-scheduler /anki.scheduler.SchedulerService/UpgradeScheduler
Flags:
-h, --help help for scheduler
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api scheduler [command] --help" for more information about a command.
anki_as_code api scheduler answer-card
/anki.scheduler.SchedulerService/AnswerCard
Request: anki.scheduler.CardAnswer
Response: anki.collection.OpChanges
Request fields:
card_id: optional int64
current_state: optional anki.scheduler.SchedulingState
new_state: optional anki.scheduler.SchedulingState
rating: optional anki.scheduler.CardAnswer.Rating
answered_at_millis: optional int64
milliseconds_taken: optional uint32
Usage:
anki_as_code api scheduler answer-card [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for answer-card
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler bury-or-suspend-cards
/anki.scheduler.SchedulerService/BuryOrSuspendCards
Request: anki.scheduler.BuryOrSuspendCardsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
note_ids: repeated int64
mode: optional anki.scheduler.BuryOrSuspendCardsRequest.Mode
Usage:
anki_as_code api scheduler bury-or-suspend-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for bury-or-suspend-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler compute-fsrs-params
/anki.scheduler.SchedulerService/ComputeFsrsParams
Request: anki.scheduler.ComputeFsrsParamsRequest
Response: anki.scheduler.ComputeFsrsParamsResponse
Request fields:
search: optional string
current_params: repeated float
ignore_revlogs_before_ms: optional int64
num_of_relearning_steps: optional uint32
health_check: optional bool
Usage:
anki_as_code api scheduler compute-fsrs-params [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-fsrs-params
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler compute-memory-state
/anki.scheduler.SchedulerService/ComputeMemoryState
Request: anki.cards.CardId
Response: anki.scheduler.ComputeMemoryStateResponse
Request fields:
cid: optional int64
Usage:
anki_as_code api scheduler compute-memory-state [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-memory-state
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler compute-optimal-retention
/anki.scheduler.SchedulerService/ComputeOptimalRetention
Request: anki.scheduler.SimulateFsrsReviewRequest
Response: anki.scheduler.ComputeOptimalRetentionResponse
Request fields:
params: repeated float
desired_retention: optional float
deck_size: optional uint32
days_to_simulate: optional uint32
new_limit: optional uint32
review_limit: optional uint32
max_interval: optional uint32
search: optional string
new_cards_ignore_review_limit: optional bool
easy_days_percentages: repeated float
review_order: optional anki.deck_config.DeckConfig.Config.ReviewCardOrder
suspend_after_lapse_count: optional uint32
historical_retention: optional float
learning_step_count: optional uint32
relearning_step_count: optional uint32
Usage:
anki_as_code api scheduler compute-optimal-retention [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for compute-optimal-retention
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler congrats-info
/anki.scheduler.SchedulerService/CongratsInfo
Request: anki.generic.Empty
Response: anki.scheduler.CongratsInfoResponse
Usage:
anki_as_code api scheduler congrats-info [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for congrats-info
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler counts-for-deck-today
/anki.scheduler.SchedulerService/CountsForDeckToday
Request: anki.decks.DeckId
Response: anki.scheduler.CountsForDeckTodayResponse
Request fields:
did: optional int64
Usage:
anki_as_code api scheduler counts-for-deck-today [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for counts-for-deck-today
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler custom-study
/anki.scheduler.SchedulerService/CustomStudy
Request: anki.scheduler.CustomStudyRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
new_limit_delta: optional int32
review_limit_delta: optional int32
forgot_days: optional uint32
review_ahead_days: optional uint32
preview_days: optional uint32
cram: optional anki.scheduler.CustomStudyRequest.Cram
Usage:
anki_as_code api scheduler custom-study [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for custom-study
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler custom-study-defaults
/anki.scheduler.SchedulerService/CustomStudyDefaults
Request: anki.scheduler.CustomStudyDefaultsRequest
Response: anki.scheduler.CustomStudyDefaultsResponse
Request fields:
deck_id: optional int64
Usage:
anki_as_code api scheduler custom-study-defaults [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for custom-study-defaults
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler describe-next-states
/anki.scheduler.SchedulerService/DescribeNextStates
Request: anki.scheduler.SchedulingStates
Response: anki.generic.StringList
Request fields:
current: optional anki.scheduler.SchedulingState
again: optional anki.scheduler.SchedulingState
hard: optional anki.scheduler.SchedulingState
good: optional anki.scheduler.SchedulingState
easy: optional anki.scheduler.SchedulingState
Usage:
anki_as_code api scheduler describe-next-states [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for describe-next-states
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler empty-filtered-deck
/anki.scheduler.SchedulerService/EmptyFilteredDeck
Request: anki.decks.DeckId
Response: anki.collection.OpChanges
Request fields:
did: optional int64
Usage:
anki_as_code api scheduler empty-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for empty-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler evaluate-params
/anki.scheduler.SchedulerService/EvaluateParams
Request: anki.scheduler.EvaluateParamsRequest
Response: anki.scheduler.EvaluateParamsResponse
Request fields:
search: optional string
ignore_revlogs_before_ms: optional int64
num_of_relearning_steps: optional uint32
Usage:
anki_as_code api scheduler evaluate-params [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for evaluate-params
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler evaluate-params-legacy
/anki.scheduler.SchedulerService/EvaluateParamsLegacy
Request: anki.scheduler.EvaluateParamsLegacyRequest
Response: anki.scheduler.EvaluateParamsResponse
Request fields:
params: repeated float
search: optional string
ignore_revlogs_before_ms: optional int64
Usage:
anki_as_code api scheduler evaluate-params-legacy [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for evaluate-params-legacy
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler extend-limits
/anki.scheduler.SchedulerService/ExtendLimits
Request: anki.scheduler.ExtendLimitsRequest
Response: anki.generic.Empty
Request fields:
deck_id: optional int64
new_delta: optional int32
review_delta: optional int32
Usage:
anki_as_code api scheduler extend-limits [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for extend-limits
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler fuzz-delta
/anki.scheduler.SchedulerService/FuzzDelta
Request: anki.scheduler.FuzzDeltaRequest
Response: anki.scheduler.FuzzDeltaResponse
Request fields:
card_id: optional int64
interval: optional uint32
Usage:
anki_as_code api scheduler fuzz-delta [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for fuzz-delta
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler get-optimal-retention-parameters
/anki.scheduler.SchedulerService/GetOptimalRetentionParameters
Request: anki.scheduler.GetOptimalRetentionParametersRequest
Response: anki.scheduler.GetOptimalRetentionParametersResponse
Request fields:
search: optional string
Usage:
anki_as_code api scheduler get-optimal-retention-parameters [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-optimal-retention-parameters
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler get-queued-cards
/anki.scheduler.SchedulerService/GetQueuedCards
Request: anki.scheduler.GetQueuedCardsRequest
Response: anki.scheduler.QueuedCards
Request fields:
fetch_limit: optional uint32
intraday_learning_only: optional bool
Usage:
anki_as_code api scheduler get-queued-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-queued-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler get-scheduling-states
/anki.scheduler.SchedulerService/GetSchedulingStates
Request: anki.cards.CardId
Response: anki.scheduler.SchedulingStates
Request fields:
cid: optional int64
Usage:
anki_as_code api scheduler get-scheduling-states [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-scheduling-states
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler grade-now
/anki.scheduler.SchedulerService/GradeNow
Request: anki.scheduler.GradeNowRequest
Response: anki.collection.OpChanges
Request fields:
card_ids: repeated int64
rating: optional anki.scheduler.CardAnswer.Rating
Usage:
anki_as_code api scheduler grade-now [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for grade-now
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler rebuild-filtered-deck
/anki.scheduler.SchedulerService/RebuildFilteredDeck
Request: anki.decks.DeckId
Response: anki.collection.OpChangesWithCount
Request fields:
did: optional int64
Usage:
anki_as_code api scheduler rebuild-filtered-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for rebuild-filtered-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler reposition-defaults
/anki.scheduler.SchedulerService/RepositionDefaults
Request: anki.generic.Empty
Response: anki.scheduler.RepositionDefaultsResponse
Usage:
anki_as_code api scheduler reposition-defaults [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for reposition-defaults
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler restore-buried-and-suspended-cards
/anki.scheduler.SchedulerService/RestoreBuriedAndSuspendedCards
Request: anki.cards.CardIds
Response: anki.collection.OpChanges
Request fields:
cids: repeated int64
Usage:
anki_as_code api scheduler restore-buried-and-suspended-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for restore-buried-and-suspended-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler sched-timing-today
/anki.scheduler.SchedulerService/SchedTimingToday
Request: anki.generic.Empty
Response: anki.scheduler.SchedTimingTodayResponse
Usage:
anki_as_code api scheduler sched-timing-today [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sched-timing-today
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler schedule-cards-as-new
/anki.scheduler.SchedulerService/ScheduleCardsAsNew
Request: anki.scheduler.ScheduleCardsAsNewRequest
Response: anki.collection.OpChanges
Request fields:
card_ids: repeated int64
log: optional bool
restore_position: optional bool
reset_counts: optional bool
context: optional anki.scheduler.ScheduleCardsAsNewRequest.Context
Usage:
anki_as_code api scheduler schedule-cards-as-new [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for schedule-cards-as-new
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler schedule-cards-as-new-defaults
/anki.scheduler.SchedulerService/ScheduleCardsAsNewDefaults
Request: anki.scheduler.ScheduleCardsAsNewDefaultsRequest
Response: anki.scheduler.ScheduleCardsAsNewDefaultsResponse
Request fields:
context: optional anki.scheduler.ScheduleCardsAsNewRequest.Context
Usage:
anki_as_code api scheduler schedule-cards-as-new-defaults [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for schedule-cards-as-new-defaults
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler set-due-date
/anki.scheduler.SchedulerService/SetDueDate
Request: anki.scheduler.SetDueDateRequest
Response: anki.collection.OpChanges
Request fields:
card_ids: repeated int64
days: optional string
config_key: optional anki.config.OptionalStringConfigKey
Usage:
anki_as_code api scheduler set-due-date [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-due-date
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler simulate-fsrs-review
/anki.scheduler.SchedulerService/SimulateFsrsReview
Request: anki.scheduler.SimulateFsrsReviewRequest
Response: anki.scheduler.SimulateFsrsReviewResponse
Request fields:
params: repeated float
desired_retention: optional float
deck_size: optional uint32
days_to_simulate: optional uint32
new_limit: optional uint32
review_limit: optional uint32
max_interval: optional uint32
search: optional string
new_cards_ignore_review_limit: optional bool
easy_days_percentages: repeated float
review_order: optional anki.deck_config.DeckConfig.Config.ReviewCardOrder
suspend_after_lapse_count: optional uint32
historical_retention: optional float
learning_step_count: optional uint32
relearning_step_count: optional uint32
Usage:
anki_as_code api scheduler simulate-fsrs-review [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for simulate-fsrs-review
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler simulate-fsrs-workload
/anki.scheduler.SchedulerService/SimulateFsrsWorkload
Request: anki.scheduler.SimulateFsrsReviewRequest
Response: anki.scheduler.SimulateFsrsWorkloadResponse
Request fields:
params: repeated float
desired_retention: optional float
deck_size: optional uint32
days_to_simulate: optional uint32
new_limit: optional uint32
review_limit: optional uint32
max_interval: optional uint32
search: optional string
new_cards_ignore_review_limit: optional bool
easy_days_percentages: repeated float
review_order: optional anki.deck_config.DeckConfig.Config.ReviewCardOrder
suspend_after_lapse_count: optional uint32
historical_retention: optional float
learning_step_count: optional uint32
relearning_step_count: optional uint32
Usage:
anki_as_code api scheduler simulate-fsrs-workload [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for simulate-fsrs-workload
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler sort-cards
/anki.scheduler.SchedulerService/SortCards
Request: anki.scheduler.SortCardsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
card_ids: repeated int64
starting_from: optional uint32
step_size: optional uint32
randomize: optional bool
shift_existing: optional bool
Usage:
anki_as_code api scheduler sort-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sort-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler sort-deck
/anki.scheduler.SchedulerService/SortDeck
Request: anki.scheduler.SortDeckRequest
Response: anki.collection.OpChangesWithCount
Request fields:
deck_id: optional int64
randomize: optional bool
Usage:
anki_as_code api scheduler sort-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for sort-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler state-is-leech
/anki.scheduler.SchedulerService/StateIsLeech
Request: anki.scheduler.SchedulingState
Response: anki.generic.Bool
Request fields:
normal: optional anki.scheduler.SchedulingState.Normal
filtered: optional anki.scheduler.SchedulingState.Filtered
custom_data: optional string
Usage:
anki_as_code api scheduler state-is-leech [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for state-is-leech
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler studied-today
/anki.scheduler.SchedulerService/StudiedToday
Request: anki.generic.Empty
Response: anki.generic.String
Usage:
anki_as_code api scheduler studied-today [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for studied-today
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler studied-today-message
/anki.scheduler.SchedulerService/StudiedTodayMessage
Request: anki.scheduler.StudiedTodayMessageRequest
Response: anki.generic.String
Request fields:
cards: optional uint32
seconds: optional double
Usage:
anki_as_code api scheduler studied-today-message [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for studied-today-message
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler unbury-deck
/anki.scheduler.SchedulerService/UnburyDeck
Request: anki.scheduler.UnburyDeckRequest
Response: anki.collection.OpChanges
Request fields:
deck_id: optional int64
mode: optional anki.scheduler.UnburyDeckRequest.Mode
Usage:
anki_as_code api scheduler unbury-deck [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for unbury-deck
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler update-stats
/anki.scheduler.SchedulerService/UpdateStats
Request: anki.scheduler.UpdateStatsRequest
Response: anki.generic.Empty
Request fields:
deck_id: optional int64
new_delta: optional int32
review_delta: optional int32
millisecond_delta: optional int32
Usage:
anki_as_code api scheduler update-stats [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for update-stats
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api scheduler upgrade-scheduler
/anki.scheduler.SchedulerService/UpgradeScheduler
Request: anki.generic.Empty
Response: anki.generic.Empty
Usage:
anki_as_code api scheduler upgrade-scheduler [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for upgrade-scheduler
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search
anki.search.SearchService
Usage:
anki_as_code api search [command]
Available Commands:
all-browser-columns /anki.search.SearchService/AllBrowserColumns
browser-row-for-id /anki.search.SearchService/BrowserRowForId
build-search-string /anki.search.SearchService/BuildSearchString
find-and-replace /anki.search.SearchService/FindAndReplace
join-search-nodes /anki.search.SearchService/JoinSearchNodes
replace-search-node /anki.search.SearchService/ReplaceSearchNode
search-cards /anki.search.SearchService/SearchCards
search-notes /anki.search.SearchService/SearchNotes
set-active-browser-columns /anki.search.SearchService/SetActiveBrowserColumns
Flags:
-h, --help help for search
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api search [command] --help" for more information about a command.
anki_as_code api search all-browser-columns
/anki.search.SearchService/AllBrowserColumns
Request: anki.generic.Empty
Response: anki.search.BrowserColumns
Usage:
anki_as_code api search all-browser-columns [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-browser-columns
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search browser-row-for-id
/anki.search.SearchService/BrowserRowForId
Request: anki.generic.Int64
Response: anki.search.BrowserRow
Request fields:
val: optional int64
Usage:
anki_as_code api search browser-row-for-id [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for browser-row-for-id
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search build-search-string
/anki.search.SearchService/BuildSearchString
Request: anki.search.SearchNode
Response: anki.generic.String
Request fields:
group: optional anki.search.SearchNode.Group
negated: optional anki.search.SearchNode
parsable_text: optional string
template: optional uint32
nid: optional int64
dupe: optional anki.search.SearchNode.Dupe
field_name: optional string
rated: optional anki.search.SearchNode.Rated
added_in_days: optional uint32
due_in_days: optional int32
flag: optional anki.search.SearchNode.Flag
card_state: optional anki.search.SearchNode.CardState
nids: optional anki.search.SearchNode.IdList
edited_in_days: optional uint32
deck: optional string
due_on_day: optional int32
tag: optional string
note: optional string
introduced_in_days: optional uint32
field: optional anki.search.SearchNode.Field
literal_text: optional string
Usage:
anki_as_code api search build-search-string [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for build-search-string
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search find-and-replace
/anki.search.SearchService/FindAndReplace
Request: anki.search.FindAndReplaceRequest
Response: anki.collection.OpChangesWithCount
Request fields:
nids: repeated int64
search: optional string
replacement: optional string
regex: optional bool
match_case: optional bool
field_name: optional string
Usage:
anki_as_code api search find-and-replace [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for find-and-replace
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search join-search-nodes
/anki.search.SearchService/JoinSearchNodes
Request: anki.search.JoinSearchNodesRequest
Response: anki.generic.String
Request fields:
joiner: optional anki.search.SearchNode.Group.Joiner
existing_node: optional anki.search.SearchNode
additional_node: optional anki.search.SearchNode
Usage:
anki_as_code api search join-search-nodes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for join-search-nodes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search replace-search-node
/anki.search.SearchService/ReplaceSearchNode
Request: anki.search.ReplaceSearchNodeRequest
Response: anki.generic.String
Request fields:
existing_node: optional anki.search.SearchNode
replacement_node: optional anki.search.SearchNode
Usage:
anki_as_code api search replace-search-node [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for replace-search-node
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search search-cards
/anki.search.SearchService/SearchCards
Request: anki.search.SearchRequest
Response: anki.search.SearchResponse
Request fields:
search: optional string
order: optional anki.search.SortOrder
Usage:
anki_as_code api search search-cards [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for search-cards
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search search-notes
/anki.search.SearchService/SearchNotes
Request: anki.search.SearchRequest
Response: anki.search.SearchResponse
Request fields:
search: optional string
order: optional anki.search.SortOrder
Usage:
anki_as_code api search search-notes [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for search-notes
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api search set-active-browser-columns
/anki.search.SearchService/SetActiveBrowserColumns
Request: anki.generic.StringList
Response: anki.generic.Empty
Request fields:
vals: repeated string
Usage:
anki_as_code api search set-active-browser-columns [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-active-browser-columns
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api stats
anki.stats.StatsService
Usage:
anki_as_code api stats [command]
Available Commands:
card-stats /anki.stats.StatsService/CardStats
get-graph-preferences /anki.stats.StatsService/GetGraphPreferences
get-review-logs /anki.stats.StatsService/GetReviewLogs
graphs /anki.stats.StatsService/Graphs
set-graph-preferences /anki.stats.StatsService/SetGraphPreferences
Flags:
-h, --help help for stats
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api stats [command] --help" for more information about a command.
anki_as_code api stats card-stats
/anki.stats.StatsService/CardStats
Request: anki.cards.CardId
Response: anki.stats.CardStatsResponse
Request fields:
cid: optional int64
Usage:
anki_as_code api stats card-stats [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for card-stats
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api stats get-graph-preferences
/anki.stats.StatsService/GetGraphPreferences
Request: anki.generic.Empty
Response: anki.stats.GraphPreferences
Usage:
anki_as_code api stats get-graph-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-graph-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api stats get-review-logs
/anki.stats.StatsService/GetReviewLogs
Request: anki.cards.CardId
Response: anki.stats.ReviewLogs
Request fields:
cid: optional int64
Usage:
anki_as_code api stats get-review-logs [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for get-review-logs
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api stats graphs
/anki.stats.StatsService/Graphs
Request: anki.stats.GraphsRequest
Response: anki.stats.GraphsResponse
Request fields:
search: optional string
days: optional uint32
Usage:
anki_as_code api stats graphs [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for graphs
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api stats set-graph-preferences
/anki.stats.StatsService/SetGraphPreferences
Request: anki.stats.GraphPreferences
Response: anki.generic.Empty
Request fields:
calendar_first_day_of_week: optional anki.stats.GraphPreferences.Weekday
card_counts_separate_inactive: optional bool
browser_links_supported: optional bool
future_due_show_backlog: optional bool
Usage:
anki_as_code api stats set-graph-preferences [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-graph-preferences
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code api sync
anki.tags.TagsService
Usage:
anki_as_code api tags [command]
Available Commands:
add-note-tags /anki.tags.TagsService/AddNoteTags
all-tags /anki.tags.TagsService/AllTags
clear-unused-tags /anki.tags.TagsService/ClearUnusedTags
complete-tag /anki.tags.TagsService/CompleteTag
find-and-replace-tag /anki.tags.TagsService/FindAndReplaceTag
remove-note-tags /anki.tags.TagsService/RemoveNoteTags
remove-tags /anki.tags.TagsService/RemoveTags
rename-tags /anki.tags.TagsService/RenameTags
reparent-tags /anki.tags.TagsService/ReparentTags
set-tag-collapsed /anki.tags.TagsService/SetTagCollapsed
tag-tree /anki.tags.TagsService/TagTree
Flags:
-h, --help help for tags
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code api tags [command] --help" for more information about a command.
/anki.tags.TagsService/AddNoteTags
Request: anki.tags.NoteIdsAndTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
tags: optional string
Usage:
anki_as_code api tags add-note-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for add-note-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/AllTags
Request: anki.generic.Empty
Response: anki.generic.StringList
Usage:
anki_as_code api tags all-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for all-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/ClearUnusedTags
Request: anki.generic.Empty
Response: anki.collection.OpChangesWithCount
Usage:
anki_as_code api tags clear-unused-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for clear-unused-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/CompleteTag
Request: anki.tags.CompleteTagRequest
Response: anki.tags.CompleteTagResponse
Request fields:
input: optional string
match_limit: optional uint32
Usage:
anki_as_code api tags complete-tag [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for complete-tag
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/FindAndReplaceTag
Request: anki.tags.FindAndReplaceTagRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
search: optional string
replacement: optional string
regex: optional bool
match_case: optional bool
Usage:
anki_as_code api tags find-and-replace-tag [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for find-and-replace-tag
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/RemoveNoteTags
Request: anki.tags.NoteIdsAndTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
note_ids: repeated int64
tags: optional string
Usage:
anki_as_code api tags remove-note-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-note-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/RemoveTags
Request: anki.generic.String
Response: anki.collection.OpChangesWithCount
Request fields:
val: optional string
Usage:
anki_as_code api tags remove-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for remove-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/RenameTags
Request: anki.tags.RenameTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
current_prefix: optional string
new_prefix: optional string
Usage:
anki_as_code api tags rename-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for rename-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/ReparentTags
Request: anki.tags.ReparentTagsRequest
Response: anki.collection.OpChangesWithCount
Request fields:
tags: repeated string
new_parent: optional string
Usage:
anki_as_code api tags reparent-tags [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for reparent-tags
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/SetTagCollapsed
Request: anki.tags.SetTagCollapsedRequest
Response: anki.collection.OpChanges
Request fields:
name: optional string
collapsed: optional bool
Usage:
anki_as_code api tags set-tag-collapsed [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for set-tag-collapsed
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
/anki.tags.TagsService/TagTree
Request: anki.generic.Empty
Response: anki.tags.TagTreeNode
Usage:
anki_as_code api tags tag-tree [flags]
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Offline .anki2 database or .colpkg archive
-h, --help help for tag-tree
--input string Request file, or - for stdin (default "-")
--input-format string Request encoding: json or toml (default "json")
--no-write-back Disable offline archive write-back
--output-format string Response encoding: json or toml (default "json")
--timeout duration Input, startup and request timeout (default 30s)
--write-back Write offline archives back on close (default true)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
5.1.2 - col
Inspect and manage Anki collections
anki_as_code col
Inspect and manage Anki collections
Usage:
anki_as_code col [flags]
anki_as_code col [command]
Aliases:
col, collection
Available Commands:
apply Reconcile an offline collection in place
build Build a new archive from the original and desired text
export Export a collection to editable TOML
plan Inspect desired collection changes
state Inspect and manage collection-backed path bindings
Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
-h, --help help for col
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code col [command] --help" for more information about a command.
anki_as_code col apply
Reconcile an offline collection in place
Usage:
anki_as_code col apply [flags]
Flags:
--collection string Anki .colpkg archive or offline .anki2 database
-h, --help help for apply
--text string Collection root config or its containing directory
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col build
Build a new archive from the original and desired text
Usage:
anki_as_code col build [flags]
Flags:
--base string Original collection archive
-h, --help help for build
--output string Destination text directory (export) or collection archive (build)
--text string Collection root config or its containing directory
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col export
Export a collection to editable TOML
Usage:
anki_as_code col export [flags]
Flags:
--collection string Anki .colpkg archive or offline .anki2 database
-h, --help help for export
--output string Destination text directory (export) or collection archive (build)
--state-output string Optional destination file for exported TOML state bindings
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col plan
Inspect desired collection changes
Usage:
anki_as_code col plan [flags]
Flags:
--collection string Anki .colpkg archive or offline .anki2 database
-h, --help help for plan
--text string Collection root config or its containing directory
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col state
Inspect and manage collection-backed path bindings
Usage:
anki_as_code col state [flags]
anki_as_code col state [command]
Available Commands:
dump Dump the stored state object
import Bind external objects to configuration paths
replace Replace the whole stored state object
update Merge an external state object into stored state
Flags:
--collection string Anki .colpkg archive or offline .anki2 database
-h, --help help for state
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
Use "anki_as_code col state [command] --help" for more information about a command.
anki_as_code col state dump
Dump the stored state object
Usage:
anki_as_code col state dump [flags]
Flags:
--format string State format: toml or json (default "toml")
-h, --help help for dump
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Anki .colpkg archive or offline .anki2 database
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col state import
Bind external objects to configuration paths
Usage:
anki_as_code col state import PATH=ID [PATH=ID...] [flags]
Flags:
-h, --help help for import
--text string Collection root config or its containing directory
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Anki .colpkg archive or offline .anki2 database
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col state replace
Replace the whole stored state object
Usage:
anki_as_code col state replace [FILE] [flags]
Flags:
--format string State format: toml or json (default "toml")
-h, --help help for replace
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Anki .colpkg archive or offline .anki2 database
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
anki_as_code col state update
Merge an external state object into stored state
Usage:
anki_as_code col state update [FILE] [flags]
Flags:
--format string State format: toml or json (default "toml")
-h, --help help for update
Global Flags:
--address string Anki backend (subprocess[+ENGINE]://NAME, inprocess[+ENGINE]://NAME, host:port, tcp:// or unix://); empty uses subprocess
--collection string Anki .colpkg archive or offline .anki2 database
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
--state-key string Collection state namespace key (default "anki_as_code/state/v1")
5.1.3 - config
Inspect and manipulate collection configuration files
anki_as_code config
Inspect and manipulate collection configuration files
Usage:
anki_as_code config [flags]
anki_as_code config [command]
Aliases:
config, conf
Available Commands:
dump Print parsed collection configurations
export Write a configuration set as TOML files
Flags:
-h, --help help for config
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code config [command] --help" for more information about a command.
anki_as_code config dump
Print parsed collection configurations
Usage:
anki_as_code config dump [flags]
Flags:
--format string Output format: json or toml (default "json")
-h, --help help for dump
--text string Collection root config or its containing directory
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code config export
Write a configuration set as TOML files
Usage:
anki_as_code config export [FILE] [flags]
Flags:
--format string Input format: json or toml (default "json")
-h, --help help for export
--output string Destination text directory (export) or collection archive (build)
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
5.1.4 - help
Help about any command
anki_as_code help
Help provides help for any command in the application.
Simply type anki_as_code help [path to command] for full details.
Usage:
anki_as_code help [command] [flags]
Flags:
-h, --help help for help
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
5.1.5 - mcp
Expose workflows and native Anki API tools over MCP
anki_as_code mcp
Expose workflows and native Anki API tools over MCP
Usage:
anki_as_code mcp [flags]
anki_as_code mcp [command]
Available Commands:
serve Serve MCP over stdin/stdout
Flags:
-h, --help help for mcp
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code mcp [command] --help" for more information about a command.
anki_as_code mcp serve
Serve MCP over stdin/stdout
Usage:
anki_as_code mcp serve [flags]
Flags:
-h, --help help for serve
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
5.1.6 - server
Manage the Anki server
anki_as_code server
Manage the Anki server
Usage:
anki_as_code server [flags]
anki_as_code server [command]
Available Commands:
run Run the linked Anki server CLI
serve Run the Anki gRPC server
Flags:
-h, --help help for server
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
Use "anki_as_code server [command] --help" for more information about a command.
anki_as_code server run
Arguments and flags are forwarded to the native CLI. Run anki_as_code server run --help for native options.
Run the linked Anki server CLI
Usage:
anki_as_code server run [flags]
Flags:
-h, --help help for run
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
anki_as_code server serve
Arguments and flags are forwarded to the native CLI. Run anki_as_code server serve --help for native options.
Run the Anki gRPC server
Usage:
anki_as_code server serve [flags]
Flags:
-h, --help help for serve
Global Flags:
--server-engine string Engine used by server commands: cgo or wasm (default: cgo, then wasm)
6 - Anki gRPC
Rust CLI exposing Anki’s backend over stdio, TCP, or Unix sockets


Anki gRPC is a Rust CLI that forwards upstream protobuf commands to Anki’s
native backend. It initializes one backend at startup using Anki’s default
options. Anki owns collection semantics; the caller owns process lifetime and
crash handling. Stdin/stdout is the default transport. TCP and Unix sockets are
also supported. Diagnostics use stderr.
Build
From the repository root:
bazel build //projects/anki_grpc:anki_grpc //projects/anki_grpc:clippy
Build an optimized worker with bazel build -c opt //projects/anki_grpc.
Optimized builds strip the final Rust executable’s debugging information and static
symbols; development builds retain them.
The third-party Anki package
owns and builds the upstream native library, source pins, schemas, and single
Cargo dependency lock. Its native build consumes no project implementation
sources or build rules. projects/anki_grpc builds our server executable and
depends on //third_party/com_github_ankitects_anki:native. Both use standard
rules_rust targets. Compilation is offline and sandboxed; supported native
builds target Linux x86_64.
Usage
The built executable lists commands when invoked without arguments or with
--help. The serve subcommand starts the server:
anki_grpc --help
anki_grpc serve
anki_grpc serve --transport stdio
anki_grpc serve --transport tcp --listen 127.0.0.1:50051
anki_grpc serve --transport unix --listen ./anki.sock
Stdio serves one gRPC HTTP/2 connection on the process pipes, reserving stdout
for protocol traffic. TCP and Unix listeners accept connections until the
process exits. They require an explicit listen address or socket path; stdio
rejects --listen. Listener startup prints Listening on tcp://ADDRESS or
Listening on unix://PATH to stderr, including the allocated port when TCP
port zero is requested. An existing Unix socket path causes startup to fail;
the caller owns removal of its socket after the server exits.
Network transports use plaintext gRPC. All connections share one initialized
backend and its open collection. Close a collection through Anki before
reopening it or shutting down the process. Disconnecting a network client
leaves the backend available to later clients.
Linked server
pkg/ankigrpc/native exposes the same Rust entry point to Go through cgo and one C ABI
argument-vector function. native.RunServer(arguments) takes a full argument vector,
including the program name, executes the native CLI and reports native failures.
The serve subcommand blocks until shutdown and owns the process’s protocol streams. The optional direct client also exposes unary commands through
owned C ABI handles and buffers, while retaining generated Anki messages.
The generic anki_as_code server run command forwards arguments to this library.
anki_as_code server serve delegates to server run serve, selecting the Rust
serve subcommand. Its collection workflows
launch that command in a child process, retaining independent termination and
crash isolation without extracting or finding another executable. The standalone
anki_grpc executable remains a thin adapter over the shared Rust library.
Both builds currently target Linux x86_64 and require the repository’s native
Rust/C toolchains; linking introduces no new external dependencies.
Offline WASI server
This mode embeds the Rust CLI in a native Go executable so applications can
avoid cgo and native Rust linkage. The Go executable still targets the host
OS and CPU; only its embedded Rust backend targets WebAssembly. Browser
execution is outside this mode’s scope.
The independent boolean //projects/anki_grpc:wasm defaults to false and
selects the standalone WASM worker when enabled. Application builds also honor
trunk’s //projects/anki_grpc:cgo boolean, which defaults to true. Build a
pure-Go application or worker with:
bazel build -c opt //projects/anki_grpc //projects/anki_as_code --//projects/anki_grpc:cgo=false --//projects/anki_grpc:wasm=true
For the application, generic subprocess and in-process selection both prefer
cgo and otherwise use WASM. With neither engine, explicit external
clients remain available and local hosting fails clearly. The command owns a
scoped factory and registers each compiled engine’s qualified subprocess
scheme. Those factories select the named engine in the application worker;
independent executables retain their exact arguments and caller-selected engine.
The generic subprocess keeps the preferred default. Generic client and
application libraries remain pure Go.
Guest and host follow the selected Bazel compilation mode. -c opt optimizes
both; omitting it retains the normal debug build. The Rust targets use
rules_rust’s built-in WASI platform attribute and embed their outputs directly.
pkg/ankigrpc/wasm is a separate pure-Go host using wazero v1.12.0. It owns building
and embedding the production guest and exposes Run(arguments), matching the
cgo adapter. Commands handle no guest bytes. internal/wasmhost accepts guest
bytes internally for production and integration fixtures and serves the same
opaque protobuf gRPC protocol. The default application strategy supervises a
child process through ankiclient. Explicit inprocess+wasm:// instead runs
the same guest inside the application’s process.
The complete Rust CLI owns gRPC framing and Anki dispatch in one guest.
Cancelling command execution closes that instance without replay or replacement. The guest receives filesystem access for the existing
absolute-path protocol. This is process isolation, with the worker’s filesystem
authority, rather than a restricted filesystem sandbox.
wasm.New() constructs an unstarted managed client. Start executes the embedded
Rust server in a goroutine and supplies a net.Pipe dialer to the shared
ankiclient.ClientGRPC. Its in-memory stdio carries the existing gRPC protocol;
no process, listening socket or cgo is needed. Startup context controls readiness
only. Each client owns separate backend state. Close collections before Stop;
Stop cancels the guest and releases its streams/runtime, while Done observes
final cleanup if the caller’s Stop deadline expires. A failed instance never
reconnects or replays requests. This strategy retains protobuf and HTTP/2 framing.
Executable composition registers inprocess+wasm:// whenever WASM is enabled;
generic inprocess:// prefers cgo when available and otherwise selects WASM.
Both backends execute the same Rust CLI and gRPC server. The WASI guest runs
on one execution thread, using an executor to schedule async futures; native
builds retain Tokio. WebAssembly supports multithreading, but this integration
does not. The guest targets wasm32-wasip1,
where Rust thread spawning is unsupported. The threaded Rust target
requires host support for WASI thread spawning. Wazero v1.12.0 provides
experimental shared-memory and atomic instructions, but no built-in WASI
thread-spawn implementation; its threading example
creates execution instances from Go. Our host neither enables that experimental
feature nor implements thread spawning. Changing the Rust target alone would
therefore be insufficient.
The Go host performs blocking I/O in goroutines and supplies
checked byte-stream imports for stdio, TCP and Unix sockets, using bounded I/O
queues and blocking readiness notifications. The command owns stream progress
and closure; pumps send results through channels, and guest tasks share the
host’s readiness notification. It implements no command parser, gRPC server,
protobuf dispatcher or Anki allocation/free API. One guest retains
the backend across all client connections. Help and invalid arguments run before
backend initialization; they do not require collection or cache access.
The guest supports offline collection, package, and local media operations.
Network sync, media sync, remote media URLs, AnkiHub, AnkiWeb, GitHub downloads,
and Anki’s HTTP sync-server entry points return explicit unsupported errors.
The host’s gRPC stdio/TCP/Unix transports remain available. The cgo backend
retains its full API. Callers must keep exclusive offline access to collection
and media paths; the WASI SQLite VFS does not coordinate locks with other
processes. The guest uses the host-supplied TMPDIR; backups and package
compression run synchronously without guest threads.
Chrono local-time lookups use the Go host timezone at the requested timestamp,
including historical offsets, DST gaps and overlaps. The host uses TZ or its
system timezone and includes standard Go timezone data for named-zone fallback.
Set ANKI_WASM_CACHE_DIR to a caller-owned directory to reuse wazero’s compiled
code across worker processes. Fresh directories are created with private
permissions; protect an existing cache from changes by other users. The cache
is optional and contains no required runtime inputs. Without it, each worker
compiles its embedded guest at startup.
The application target //projects/anki_as_code with the same backend setting uses the same
worker model inside one installed executable. Its shared entry point hosts either
compiled adapter; generic strategies prefer cgo, while qualified schemes select
their engine explicitly. Both command names stay unchanged. The Go executable
retains the host OS/CPU platform; only the embedded Rust guest targets WASI. The following checks exercise the actual Anki guest,
its unsupported HTTP sync-server entry points, command failures, process
transports, and the pinned SQLite build:
bazel test //projects/anki_grpc/internal/wasmhost:backend_test \
//projects/anki_grpc/test/wasm:inprocess_test \
//projects/anki_grpc/test/wasm:offline_test \
//projects/anki_grpc/test/wasm:http_server_test \
//projects/anki_grpc/test/wasm:worker_test \
//projects/anki_grpc/test/wasm:sqlite_test
The worker check copies its executable alone and verifies stdio/TCP/Unix gRPC,
error trailers, and shutdown. The SQLite check retains wasi-sqlite.anki2 with
an 11 MiB payload and sqlite-verification.txt in its test outputs; native and
WASI SQLite independently reopen it. The application wasm_workflow_test
retains large-field-roundtrip.colpkg with a 17 MiB note field and checks its
identity, scheduling, review history and media through native Anki after export.
Runtime comparison
This snapshot was checked on 21 October 2026. Approximate GitHub star counts
refer to the runtime repository, not its smaller Go wrapper. The cgo column
describes the standard in-process Go binding linked in that row.
Core thread instructions, guest thread spawning and Go API support are separate
capabilities. This comparison checks upstream source and documentation; it is
not an Anki compatibility test.
Project layout
cmd/anki_grpc/main.rs: Standalone executable adapter.pkg/ankiserver/lib.rs: Transport listeners, opaque protobuf codec, and Anki dispatch.pkg/ankiserver/cli.rs: Shared Rust CLI, help and transport validation.internal/backend/: Shared Rust backend dispatch and descriptor-generated command lookup.pkg/ankigrpc/native/: Optional native C ABI bridge, CLI hosting and client registration.pkg/ankigrpc/: Pure Go connection-string routing and client construction.pkg/ankigrpc/wasm/: Production WASI command build, embedding and argument-vector API.internal/wasmhost/: Pure-Go WASI execution, native byte streams and timezone callbacks.pkg/ankiclient/: Reusable Go owner of the server process and gRPC connection.docs/architecture.mmd: Client, server, and storage diagram source.test/transport/: CLI and network transport E2E using official Anki messages.rustfmt.toml: Rust 2021 formatting settings for the project.releases/: Standard binary metadata for the repository release registry.
Protocol and ownership
RPC paths use upstream service and method names, such as
/anki.collection.BackendCollectionService/OpenCollection and
/anki.notes.NotesService/GetNote. Anki decodes
requests and encodes responses using its own schema bindings. Clients can call
upstream operations immediately after connecting; initialization belongs to the
server and requires no RPC. Operation failures include Anki’s serialized
BackendError in the binary anki-error-bin trailer. The transport uses stable
Tonic 0.14.6.
Native dispatch runs on blocking threads because Anki owns its own runtime and
operation synchronization. WASI serializes dispatch inside its single-thread
command. Worker panics terminate the process; WASM traps fail that command. A cancelled
RPC does not promise rollback of a mutation already running in Anki.
Anki implicitly forwards collection-service methods through its backend services.
The descriptor generator exposes both original service paths for generated clients
and backend-prefixed paths for existing callers, using Anki’s own method indices.
Methods declared in both services must have matching request and response schemas.
TCP and Unix clients can use normal gRPC connections with the same generated clients.
Go client
Import git.alwaldend.com/alwaldend/src/projects/anki_grpc/pkg/ankigrpc for
NewClient(address). It constructs an unstarted lifecycle owner. TCP and Unix
endpoints are built in; other schemes require explicit registration. Empty library
addresses are rejected because the library owns no default worker entrypoint.
The executable creates a configured factory and registers its worker schemes:
factory := ankigrpc.NewFactory(ankigrpc.SubprocessAddress(workerPath, "serve"))
factory.RegisterClientFactory("subprocess", ankigrpc.ToClientFactory(ankigrpc.NewSubprocessClient))
NewSubprocessClient returns the concrete stdio client and requires an executable
in the URL. Use ankigrpc.SubprocessAddress(binary, arguments...) to preserve
literal paths and argv. Arguments are passed exactly, including zero arguments.
The executable owns supported worker schemes, entrypoints, server arguments and
its configured default. NewFactory snapshots built-in and opt-in package registrations;
later registrations remain private to that factory. Explicit addresses override the
default for one construction only. Package-level registration remains available for
opt-in adapters, and package-level NewClient retains no default. Importing the
native package does not register subprocess workers.
ClientFactory is func(string) (ankiclient.StartableClient, error).
Pass a concrete Factory’s NewClient method value when injecting its registry and
default selection. ToClientFactory adapts a typed constructor with contextual
error wrapping; a nil constructor produces a nil function. Registration rejects
nil factories. The factory returns the constructed client directly. Scheme
dispatch and consumer injection use the same three-method contract. Registrations retain
constructors, never clients, and reject duplicate or invalid schemes. Unavailable
schemes fail without fallback. Native workers receive no injected platform flags.
WithClient(ctx, factory, address, operation) constructs through the supplied
factory (or NewClient when nil), starts the client, lends its ready connection
and stops it with a five-second budget independent of request cancellation. It
opens and reserves no collection. Callers own native collection open/close,
archive publication and source reservations.
Import the optional ankigrpc/native package for direct client registration and
native CLI hosting. It registers only inprocess and inprocess+cgo; each label
creates fresh state. Start initializes Anki synchronously, checking its context
before and after; cancellation waits for initialization and failure cleanup.
Command cancellation stops waiting without interrupting Rust, and Stop rejects new calls while draining
active work. Its deadline bounds waiting; the concrete client’s Done method
observes final cleanup. Native
crashes affect the hosting process, and streaming and unsupported call options
fail explicitly. Native errors retain the transport’s error-decoding contract.
Core and application imports remain pure Go. Managed collection paths use the
selected client regardless of transport. Client implementations manage their own
resource lifetimes; callers do not query backend ownership. Private schemes and
injected constructor functions work without global registration.
Routing identifies only the scheme and passes the selected address unchanged.
The transport constructor parses it once. Network clients retain decoded endpoints,
including raw and escaped IPv6 zones and relative Unix socket paths containing spaces.
pkg/ankiclient.Client exposes Connection and Stop for callers that use and
release an owned connection. StartableClient embeds Client and adds Start
for callers that control startup. Prepared application collection handles use
the shared Client interface.
Concrete clients own their transport readiness and cleanup; constructors perform
no startup I/O. Collection operations use generated native service clients.
Concrete owned transports expose Done for native work that can outlive a
cancelled Stop wait. Completion observation adds no public client interface.
ClientSTD implements StartableClient using the server’s stdin/stdout. ankiclient.NewSTD accepts
one ClientSTDOptions value with Binary, Arguments, and ShutdownTimeout.
It copies the arguments without starting a process. A zero shutdown timeout uses
five seconds; Start rejects negative timeouts. Start
launches the server and creates its gRPC connection, waiting for readiness. Its
context controls startup only: cancelling it after successful startup leaves the
worker running. The child inherits the parent
environment and stderr. The caller supplies the exact server executable. Callers declare the executable as a runtime input. Failed startup releases its
resources and reaps the child.
The process client owns a separate lifetime context for the command.
The client exposes grpc.ClientConnInterface through Connection. Construct
Anki’s generated service clients with it; each method accepts a typed request and
returns a typed response. There are no handwritten per-operation wrappers.
worker, err := factory.NewClient("")
if err != nil {
return fmt.Errorf("construct Anki client: %w", err)
}
if err := worker.Start(ctx); err != nil {
return fmt.Errorf("start Anki: %w", err)
}
connection, err := worker.Connection()
if err != nil {
return fmt.Errorf("get Anki connection: %w", err)
}
collections := collection.NewBackendCollectionServiceClient(connection)
items := notes.NewNotesServiceClient(connection)
_, err = collections.OpenCollection(ctx, &collection.OpenCollectionRequest{
CollectionPath: "/path/to/collection.anki2",
MediaFolderPath: "/path/to/collection.media",
MediaDbPath: "/path/to/collection.media.db2",
})
if err != nil {
return fmt.Errorf("open collection: %w", err)
}
note, err := items.GetNote(ctx, ¬es.NoteId{Nid: noteID})
Generated clients use the upstream Go packages, such as
github.com/ankitects/anki/proto/anki/collection and
github.com/ankitects/anki/proto/anki/notes. Use BackendCollectionServiceClient
for collection open/close and NotesServiceClient, NotetypesServiceClient,
DecksServiceClient, or CardsServiceClient for collection operations.
One connection interceptor rejects calls after shutdown and decodes Anki’s error
trailers, preserving gRPC status, context causes, and caller call options. Failed
calls are never automatically replayed or sent to a replacement process.
Cancellation stops waiting without guaranteeing rollback of a native mutation.
When using raw native OpenCollection as above, close that storage through
collections.CloseCollection before calling worker.Stop(ctx). Native full-package
export consumes collection storage, so callers must avoid closing it twice.
The process transport signals EOF while draining stdout, waits for exit and
forces termination when its own shutdown budget expires. It completes reaping
and retains unexpected process-exit errors on repeated Stop calls.
Stop is safe before Start and after startup failure. Each client permits one
Start attempt; use a new instance for a new transport. Connection rejects access
before readiness, while stopping and after transport exit. Retained generated
clients reject calls once their transport stops. Shut down the owning client
through Stop. Callers requiring final native completion after a cleanup error
can observe Done on the concrete owned transport.
The client library supplies no server executable or implicit runtime dependency.
Callers package their configured executable; native tests declare their own fixtures.
Existing gRPC server
ankiclient.NewGRPC(endpoint) validates the
endpoint and returns (*ClientGRPC, error) without contacting the server. It implements
StartableClient for a running server. Endpoints accept
TCP host:port, tcp://host:port, unix:///absolute/path and absolute socket paths.
Unix URI paths may also be relative to the client’s working directory.
Start waits for readiness within its context. Stop closes only the client;
it does not stop the remote server or close its collection. Retained clients
reject calls after Stop. Native error trailers are decoded as for stdio.
ankiclient.NewGRPCWithDialer(dial) provides the same lifecycle and RPC handling
for a caller-supplied net.Conn. The WASM adapter supplies a single-use memory
stream and retains ownership of guest execution. Other dialers may reconnect;
neither client replays failed RPCs.
Application scopes
Applications own collection paths, archive restore/publication and source
reservations. They use the client connection for generated native RPCs and stop
the transport after collection cleanup. The
Anki as Code collection store
provides managed callback scopes and already-open application handles.
The Go package is ankiclient; anki_grpc is the project and server name.
Concrete client types include ClientSTD and ClientGRPC.
Verification
bazel test //projects/anki_grpc/test/transport:transport_test
bazel test //projects/anki_grpc/pkg/ankiclient:ankiclient_test
The server E2E checks CLI help, invalid arguments, startup initialization,
persistence, and reconnection over both TCP and Unix sockets. It emits closed
SQLite collections and JSON verification reports as repeatable artifacts.
The Go backend E2E uses generated clients over default stdio and checks native
persistence, generated cards, original service routes, overlapping service methods,
caller error trailers, concurrent calls, cancellation, startup deadlines, shutdown,
and process failures. It also verifies constructor configuration, argument copying,
repeated startup, stop before start, invalid arguments, startup-context isolation,
connection errors during startup/shutdown, Stop deadlines, and OS-observed child
reaping. Shutdown cases cover deadlines, explicit cancellation, the default
five-second grace period, and a configured grace period. They also verify invalid
timeout rejection and native failure details. The forwarding fixture reaps its
inner Anki process before testing forced shutdown of the outer worker. It emits collection.anki2
and JSON verification reports.
The collection-lifecycle E2E verifies one client reusing its transport, direct database
persistence and media layout, native package exports/restores, temporary cleanup,
persistent destinations, retained-connection rejection, raw access between collections and failed or
cancelled lifecycle calls. It emits a native database/package and verification report.
It also blocks a real native media download, cancels the client, and verifies
that shutdown waits for active callers and retains unconfirmed restores until
backend shutdown.
Application scope verification belongs to the Anki as code collection-store E2E.
It exercises real workers across callback success, failure, cancellation, panic
and crashes, checking process reaping, source reuse and archive preservation.
7 - Ansible collection
Ansible collection alwaldend.main with Bazel source packaging
alwaldend.main is the repository’s Ansible collection. Bazel packages its
Ansible source for reuse in repository automation.
Links
Features
- Ansible collection
- Bazel-managed Ansible source packaging.
Galaxy
namespace: alwaldend
name: main
version: 0.0.0
readme: README.md
authors:
- <example@domain.com>
description: main alwaldend ansible collection
license:
- AGPL-3.0-or-later
license_file: LICENSE.txt
tags: []
dependencies:
ansible.posix: 1.5.4
community.crypto: 2.17.0
community.general: 11.3.0
devsec.hardening: 9.0.1
community.docker: 3.11.0
repository: https://git.alwaldend.com/src
documentation: https://collection-main.docs.alwaldend.com
homepage: https://collection-main.docs.alwaldend.com
issues: ""
build_ignore: []
7.1 - Playbooks
Ansible playbooks
7.2.1 - Adguard
Role to deploy adguard
7.2.1.1 - Defaults
Defaults for adguard
adguard_dir: /etc/adguard
adguard_work_dir: "{{ adguard_dir }}"
adguard_gpg_key_url: https://keys.openpgp.org/vks/v1/by-fingerprint/28645AC9776EC4C00BCE2AFC0FE641E7235E2EC6
adguard_gpg_key_src: files/key.asc
adguard_gpg_key_path: "{{ adguard_dir }}/release-key.asc"
adguard_gpg_key_checksum: "22d78dbacb461667861ee7d2dd13d13240ee003d"
adguard_release_source_url: https://github.com/AdguardTeam/AdGuardHome/releases/download
adguard_release_version: v0.107.48
adguard_release_checksum: "sha512:c0a336212e3792ae6fc6b8de976befce0038c5d6ddde919a00994c43a929349958c7bd65f7fb7fdd471962afa20855ecbf5830cc7a1d26f3037a716db638c101"
adguard_release_distrib: AdGuardHome_linux_amd64.tar.gz
adguard_release_url: "{{ adguard_release_source_url }}/{{ adguard_release_version }}/{{ adguard_release_distrib }}"
adguard_release_archive_dest: "{{ adguard_dir }}/release-{{ adguard_release_version }}-{{ adguard_release_distrib }}"
adguard_release_dest: "{{ adguard_dir }}/release-{{ adguard_release_version }}"
adguard_release_dir: "{{ adguard_release_dest }}/AdGuardHome"
adguard_release_bin: "{{ adguard_release_dir }}/AdGuardHome"
adguard_release_sig: "{{ adguard_release_bin }}.sig"
7.2.2 - Caddy
Role to deploy caddy
7.2.2.1 - Defaults
Defaults for caddy
caddy_enabled: false
caddy_user: caddy
caddy_config_path: /etc/caddy/Caddyfile
caddy_config_dir: /etc/caddy/configs
caddy_config: |
import {{ caddy_config_dir }}/*
7.2.3.1 - Defaults
Defaults for cifs
cifs_enabled: false
cifs_systemd_dir: /etc/systemd/system
cifs_mounts: []
7.2.4 - ClamAV scan
Native endpoint scans through a private controller ClamAV socket
alwaldend.main.clamav_scan unpacks the official pinned ClamAV payload into
private endpoint scratch and runs native clamdscan --stream. The caller owns
the controller daemon, fresh signatures, parser settings, and its lifecycle.
The role installs no host package, service, schedule, or persistent SSH
configuration. It does not reboot, quarantine, delete scanned files, or expose
TCP. Check mode is unsupported.
Supply clamav_scan_archive as the controller path to
//third_party/com_github_cisco_talos_clamav:payload_tar, the compressed DEB data
payload containing usr/local. Endpoints need Linux x86_64, compatible glibc,
tar, GNU timeout, nice, ionice, root escalation, and Ansible’s existing Python
runtime. Failed or unreachable extraction stops preparation before the native
execution preflight; both results are retained privately. A failed preflight
does not by itself identify an architecture or library mismatch. Older XCP-ng
compatibility is deferred; there is no custom scanner or compatibility fallback.
Supply clamav_scan_socket as an existing absolute controller Unix socket and
clamav_scan_report_directory as an existing absolute controller-owned 0700
directory under ignored task scratch. Socket paths use ASCII letters, digits,
underscores, dots, slashes, and hyphens. IPC sockets use the controller’s native
XDG_RUNTIME_DIR, required to be operator-owned mode 0700. Each SSH master
gets its own temporary subdirectory there, independent of the daemon’s runtime
directory so daemon failure cannot remove a connection needed for recovery.
The absolute control path is limited to 90 bytes, reserving OpenSSH’s temporary
suffix. Report and scan paths must not contain #.
Remote runs allocate the dedicated ControlPath entirely on the controller and
establish a persistent SSH master before any endpoint command, including boot
identity, tempfile creation, and Ansible module bootstrap. Caller arguments are
captured once before overrides; the master preserves injected authentication,
host aliases, and caller options. Endpoint operations then create a
connection-user-owned 0700 Unix transport directory and separate root-owned
0700 scan scratch. Transport-directory creation and removal set
the task variable ansible_become: false so inventory escalation cannot change
their owner; scanner tasks retain root escalation. Explicit mux operations target only this master to attach
one reverse Unix forward, cancel it, and exit the master. No
meta: reset_connection is used. Local runs use the direct controller socket.
Native --ping=1:1 is a connectivity preflight: ClamAV 1.5.4 prints PONG after
connect/send without reading a daemon reply. Actual scan fixtures establish
that the daemon processes requests.
The native configuration disables file and directory symlink following, limits
recursion to 1000, and excludes /proc, /sys, role scratch, and
clamav_scan_exclude_paths with escaped, anchored subtree expressions. It does
not exclude all of /dev. Ansible inspects metadata beneath /dev without
following symlinks or opening file contents, and excludes the actual block and
character device nodes. Incomplete discovery prevents scanning. Their paths and
discovery failures are retained in the receipt; regular files under /dev/shm
remain eligible. Roots default to [/].
The caller’s daemon must use StreamMaxLength 104857601,
MaxFileSize 104857600, HeuristicAlerts yes, and AlertExceedsMax yes.
clamav_scan_max_file_bytes stays fixed at 104857600; the unchanged client
max_file_bytes + 1 expression produces a stream limit of 104857601, equal to
the controller stream limit. This lets the extra byte reach the engine, where
the lower file limit reports Heuristics.Limits.Exceeded.MaxFileSize FOUND.
Native traversal continues to later files without a successful truncated-prefix
verdict. All four controller settings are required; the role cannot attest
caller-owned daemon configuration.
Scanning uses timeout --signal=TERM --kill-after=15s, nice -n 19, and
ionice -c 3 by default. Set clamav_scan_background: false for Nice 0 and
best-effort I/O priority 4. Set clamav_scan_multiscan: true to pipeline native
streams for concurrent processing by the controller workers. It remains one
uploader; increasing daemon workers alone does not parallelize sequential
submission. Both controls are booleans recorded in the private receipt, and
neither changes coverage or parser limits. The deadline defaults to 86400 seconds, bounded to seven days;
Ansible async allows 60 seconds of additional supervision and polls every
15 seconds. Bundled library/certificate paths are explicit. The role takes the
native return code from a finished Ansible async result; missing, unreachable,
or unfinished results cannot supply a scanner status. Async polling returns
the result as data independently of the polling process exit. Synchronous
runtime/connectivity preflights retain their password-transport status wrappers.
Timeout remains incomplete.
Native exit 0 reports no detection, 1 reports detections, and 2 reports an
operational error. Exit 1 can mask errors, so the role also reads the final
summary’s Infected files and Total errors. Those counters do not account
for every session failure: the role also checks the entire
retained console for native ERROR: diagnostics and file-error records before
accepting completion. The check’s result is retained; failure to read the log
or an error diagnostic keeps the receipt incomplete. The native infected count
includes limits and encrypted-content heuristics; it is not a malware-only
count. The role does not parse every filename or invent a scanned-file count.
In ClamAV 1.5.4, a multiscan detection can also mask a silent session failure.
Consequently, multiscan exit 1 retains findings and terminal status but sets
native_completion_uncertain: true and complete: false, even if no errors
are printed. This conservative outcome includes heuristic-only detections;
it does not classify them as malware. Sequential scans retain their existing
completion rules, and multiscan exit 0 still requires the other checks.
Raw 0600 console.log, clamav.log, and
controller receipt.json remain in the unique 0700
clamav_scan_result_directory.
The initial receipt is incomplete and precedes endpoint operations. It records
boot identity before/after, recovery paths, native runtime diagnostics, exit,
summary counts, retention, and cleanup. The master-start result and both
boot-command results, including failed and unreachable errors, are retained
privately. The initial boot result is saved before its success assertion;
boot-after is skipped when neither local transport nor a successful dedicated
master is available. A failed identity check cannot establish an unchanged
boot identity. execution_finished records native terminal status, including
exit 2. complete additionally requires exit 0 or 1,
a valid summary without reported errors, unchanged boot identity, verified logs,
and successful cleanup. Neither means the host is clean: coverage_complete
remains false and clean remains null. Live files can change, exclusions and
recursion limits omit content, and parser settings constrain inspection.
Scanning a host disk image does not establish guest-filesystem coverage.
Native registered results are the source of status and summary fields. One
final Ansible assertion validates execution, evidence and cleanup, and its
result supplies completion. Receipts before that assertion remain incomplete;
there is no incrementally updated completion flag. native_extraction retains the full unarchive result.
Artifact transfer relies on Ansible fetch’s checksum validation; collection
failure preserves endpoint evidence and its recovery path.
Recovery explicitly cancels only a role-owned forward whose setup succeeded
with exit code 0. Local, skipped, and never-attempted forwards need no release;
failed or uncertain remote forwarding remains conservative. It then
collects logs and cleans verified scratch through the existing authenticated
master. Long scans need no fresh certificate on this normal recovery path.
A nested always exits only that
master and restores caller arguments. Available logs are collected independently
on failure or unreachable results. Scan scratch is deleted only after both logs
are verified retained, a receipt is saved, and terminal process status is known.
Lost connections or failed retention preserve recovery paths; fresh authorized
authentication may be needed to recover them.
7.2.4.1 - Defaults
Defaults for clamav_scan
# Existing controller clamd Unix socket; its owner manages signatures/lifecycle.
clamav_scan_socket: "{{ undefined() }}"
# Controller path to //third_party/com_github_cisco_talos_clamav:payload_tar.
clamav_scan_archive: "{{ undefined() }}"
# Existing absolute controller-owned directory with mode 0700.
clamav_scan_report_directory: "{{ undefined() }}"
# GNU timeout deadline, then 15-second kill grace and Ansible supervisor slack.
clamav_scan_timeout_seconds: 86400
# Background scheduling preserves capacity for application workloads.
clamav_scan_background: true
# Native session mode permits concurrent engine processing of uploaded files.
clamav_scan_multiscan: false
# Controller MaxFileSize; client and server stream limits use one extra byte.
clamav_scan_max_file_bytes: 104857600
# Visit all regular files under these roots, subject to recorded omissions.
clamav_scan_roots: [/]
# Explicit subtrees to omit; exclusions are recorded as coverage limitations.
clamav_scan_exclude_paths: []
7.2.5 - ComfyUI tools role
Install selected ComfyUI models, node packs, workflows and dependencies
This role configures an existing ComfyUI installation from ordinary role
variables. Supply the application directory, runtime arguments and model-directory
map, plus the selected model entries, Git node packs, first-party source paths,
repository-built node bundles, and workflow files. Supply node bundles rooted
at custom_nodes/<directory> and keyed by that directory name.
Required inputs default to null and are validated before
installation; optional inputs have static defaults.
Application and state directory paths may contain hidden components such as
.cache. Supply normalized absolute paths with no . or .. components.
The role knows no profile registry or JSON schema. The deployment playbook
loads its JSON and translates it into those variables once, without mutable
profile facts. Other callers can supply the same variables directly. Large
artifacts remain caller dependencies rather than dependencies of every
collection consumer.
defaults/main.yaml documents the complete input contract. Public model URLs
require a publisher commit or SHA-256. Git packs require full commit IDs.
Loopback HTTP model fixtures and local Git repositories are supported for local
acceptance. Gated Hugging Face downloads receive the optional token only on
the publisher request; tasks hide it and redirects do not forward it. The role
accepts comfyui_tools_hugging_face_token as a caller input and never contacts
Vault itself. Set comfyui_tools_require_hugging_face_token when selected model
downloads require authentication. This deployment obtains the token through AL
injection and maps its environment value in the playbook.
Requirements use the existing Python environment with --require-hashes --no-deps.
The role waits for the aggregate /prompt idle count before installation,
before changing loaded code and before restart. It reads no prompts, queue
entries, job history, inputs or outputs. This is an operator-coordinated idle
window, not a lock against another client submitting new work. Changed model,
node, dependency or argument inputs notify one restart. Workflows do not require
a restart. Pass --skip-tags workflows to preserve operator workflow edits.
Unselected files and generated images are retained.
The role manages COMFYUI_ARGS in the supplied environment file. Its baseline
arguments come from the caller; only installed node directories are appended
to the whitelist. The Vast bootstrap preserves this line across reboot.
The optional pinned Video2X installation currently uses /opt/imagegen, the
sequence node’s established tool contract. Other application paths are configurable.
The local acceptance fixture runs the
packaged role without a GPU, SSH connection, account credential or live service.
7.2.5.1 - Defaults
Defaults for comfyui_tools
# Required caller inputs for the existing ComfyUI installation.
comfyui_tools_directory: null
comfyui_tools_arguments: null
comfyui_tools_model_directories: null
comfyui_tools_python_environment: /venv/main
comfyui_tools_state_directory: /opt/imagegen
comfyui_tools_environment_file: /etc/environment
comfyui_tools_api_url: http://127.0.0.1:18188
comfyui_tools_restart_command: [supervisorctl, restart, comfyui]
comfyui_tools_idle_retries: 60
comfyui_tools_idle_delay: 5
# Model entries: filename, kind, immutable URL and optional sha256.
comfyui_tools_models: []
comfyui_tools_hugging_face_token: ""
comfyui_tools_require_hugging_face_token: false
# Git packs: directory name -> {url, ref}; ref is a full immutable commit.
comfyui_tools_git_nodes: {}
# First-party modules and browser scripts: directory name -> controller file.
comfyui_tools_node_sources: {}
comfyui_tools_node_web_scripts: {}
# Repository-built archives rooted at custom_nodes/<directory>: directory name -> controller file.
comfyui_tools_node_archives: {}
# Controller files for locked requirements, native workflows and optional Video2X.
comfyui_tools_python_requirements: ""
comfyui_tools_workflows: []
comfyui_tools_required_nodes: []
comfyui_tools_interpolation_source: ""
7.2.6.1 - Defaults
Defaults for consul
consul_user: consul
consul_user_uid: 4266
consul_dir: "/opt/consul"
consul_data_dir: "{{ consul_dir }}/data"
consul_config_dir: "{{ consul_dir }}/configs"
consul_config_path: "{{ consul_config_dir }}/consul.hcl"
consul_config_local_path: "files/consul.hcl"
consul_log_dir: "{{ consul_dir }}/logs"
consul_tls_dir: "{{ consul_dir }}/tls"
consul_service_path: "/lib/systemd/system/consul.service"
consul_tls_ca_file_local_path: files/pki_ca_servers.crt
consul_tls_ca_file_path: "{{ consul_tls_dir }}/tls_ca_file.crt"
consul_tls_cert_file_path: "{{ consul_tls_dir }}/cert_file.crt"
consul_tls_key_file_path: "{{ consul_tls_dir }}/key_file.crt"
consul_tls_common_name: "{{ inventory_hostname }}"
consul_tls_ttl: "2629746" # month
consul_tls_alt_names: ""
consul_vault_local_path: "{{ role_path }}/files/vault"
consul_bin_local_path: "{{ role_path }}/files/consul"
consul_bin_path: /usr/bin/consul
7.2.7 - Consul
Setup consul
7.2.7.1 - Defaults
Defaults for consul_old
consul_is_server: false
consul_user_name: consul
consul_user_uid:
consul_dir: "/opt/consul"
consul_persistence_dir: "{{ consul_dir }}"
consul_releases_dir: "{{ consul_dir }}/releases"
consul_config_symlink_dir: "{{ consul_configs_dir }}/current"
consul_config_symlink_data_dir: "{{ consul_config_symlink_dir }}/configs"
consul_configs_dir: "{{ consul_persistence_dir }}/configs/{{ inventory_hostname }}"
consul_data_dir: "{{ consul_persistence_dir }}/data/{{ inventory_hostname }}"
consul_config_path: "{{ consul_config_config_dir }}/consul.json"
consul_config_dir: "{{ consul_configs_dir }}/{{ consul_config_dir_name }}"
consul_config_data_dir: "{{ consul_config_dir }}/data"
consul_config_config_dir: "{{ consul_config_dir }}/configs"
consul_config_dir_name: "{{ consul_config_version }}"
consul_config_version: "{{ lookup('ansible.builtin.pipe', 'git rev-parse HEAD') }}"
consul_env: {}
consul_configs: []
consul_env_path: "{{ consul_config_data_dir }}/consul.env"
consul_env_symlink_path: "{{ consul_config_symlink_dir }}/data/consul.env"
consul_release_dir: "{{ consul_releases_dir }}/{{ consul_release_dir_name }}"
consul_release_dir_name: "{{ consul_release_version }}"
consul_release_symlink_path: "{{ consul_releases_dir }}/current"
consul_release_symlink_bin_path: "{{ consul_release_symlink_path }}/consul"
consul_release_version: 1.20.2
consul_release_archive_name: "consul_{{ consul_release_version }}_linux_amd64"
consul_release_archive_fullname: "{{ consul_release_archive_name }}.zip"
consul_release_bin_path: "{{ consul_release_dir }}/consul"
consul_release_url: "https://releases.hashicorp.com/consul/{{ consul_release_version }}/{{ consul_release_archive_fullname }}"
consul_release_checksum: "sha256:1bf7ddf332f02e6e36082b0fdf6c3e8ce12a391e7ec7dafd3237bb12766a7fd5"
consul_agent_ca_cert_path: "{{ consul_config_data_dir }}/agent_ca_cert.pub"
consul_agent_ca_cert:
consul_server_cert_path: "{{ consul_config_data_dir }}/server_cert_{{ inventory_hostname }}.pub"
consul_server_cert:
consul_server_key_path: "{{ consul_config_data_dir }}/server_cert_{{ inventory_hostname }}.key"
consul_server_key:
7.2.8 - Consul envoy
Setup envoy for consul
7.2.8.1 - Defaults
Defaults for consul_envoy
consul_envoy_dir: "/opt/consul_envoy"
consul_envoy_deployments_dir: "{{ consul_envoy_dir }}/deployments"
consul_envoy_releases_dir: "{{ consul_envoy_dir }}/releases"
consul_envoy_deployment_dir: "{{ consul_envoy_deployments_dir }}/{{ consul_envoy_deployment_version }}"
consul_envoy_release_dir: "{{ consul_envoy_releases_dir }}/{{ consul_envoy_release_version }}"
consul_envoy_configs_dir: "{{ consul_envoy_deployment_dir }}/configs"
consul_envoy_bootstrap_config_path: "{{ consul_envoy_configs_dir }}/bootstrap.json"
consul_envoy_deployment_version: "{{ lookup('ansible.builtin.pipe', 'git rev-parse HEAD') }}"
consul_envoy_user_name: consul_envoy
consul_envoy_release_version: 1.31.0
consul_envoy_release_archive_fullname: "envoy_{{ consul_envoy_release_version }}_linux_amd64.zip"
consul_envoy_release_url: "https://releases.hashicorp.com/envoy/{{ consul_envoy_release_version }}/{{ consul_envoy_release_archive_fullname }}"
consul_envoy_release_bin_path: "{{ consul_envoy_release_dir }}/envoy"
consul_envoy_release_symlink_path: "{{ consul_envoy_releases_dir }}/current"
consul_envoy_release_checksum: "sha256:350782275de0fe50699844b4f9096d77a0193a5bcf205e14b8ad964ec429d45e"
7.2.9 - Dev VM
Set up repositories and packages for a development VM
The default task entry point configures package repositories and development
packages. It uses the same dev_vm_packages list with either the ordinary
package manager or RPM-OSTree layering. dev_vm_package_backend accepts
auto, package, or rpm_ostree; auto selects RPM-OSTree when
/run/ostree-booted exists. Set dev_vm_install_packages to false to skip
repository and package management entirely.
RPM-OSTree changes are staged for the next boot by default. The role reports a
pending deployment but does not reboot the host. Set
dev_vm_rpm_ostree_apply_live to true only when live application is known to
be safe for the selected packages.
The packaged Fedora mirror and Bazelisk tool currently make this role specific
to Linux x86-64 development hosts.
The packages task entry point exposes package management separately from
other role tasks. The bazel task entry point installs a caller-provided Bazel
rc, Bazelisk, and the repository’s al runner for one developer
account.
Import the Bazel entry point with tasks_from: bazel and set:
dev_vm_bazel_user: owner of the installed files.dev_vm_bazel_group: group of the installed files; defaults to the user.dev_vm_bazel_home: absolute home directory for the developer account.dev_vm_bazelrc_src: controller-side Bazel rc source; defaults to bazelrc.dev_vm_bazelisk_src: controller-side Bazelisk source; defaults to
bazelisk.dev_vm_al_src: controller-side al source; defaults to
al.
The role packages its default Linux x86-64 Bazelisk and al sources.
The calling playbook must package the Bazel rc, plus any overridden binary
sources, in an Ansible file search path. Cache storage and machine-specific
Bazel settings remain the caller’s responsibility.
The optional android task entry point installs the caller-packaged repository
Android installer as dev_vm_bazel_user. Supply dev_vm_android_installer_src
and dev_vm_android_packages_src from //tools/android. It installs missing
packages, accepts their licenses as part of the requested deployment, verifies
each package receipt, and points ndk/current at the selected NDK. It requires
the role’s Java package and does not invoke Bazel on the destination host.
7.2.9.1 - Defaults
Defaults for dev_vm
---
dev_vm_install_packages: true
dev_vm_package_backend: auto
dev_vm_rpm_ostree_apply_live: false
dev_vm_packages:
- acl
- clang
- clang-tools-extra
- java-latest-openjdk-devel
- rust
- cargo
- mesa-libGL-devel
- go
- Xvfb
- python3
- gmp-devel
- patch
- podman
- git
- git-lfs
- fuse
- fuse-libs
- pcsc-lite
- pcsc-lite-devel
- openssl
- gnutls-utils
- opensc
- openssl-pkcs11
- libdnet
- qemu-kvm
- qemu-img
dev_vm_bazel_user: "{{ undefined() }}"
dev_vm_bazel_group: "{{ dev_vm_bazel_user }}"
dev_vm_bazel_home: "{{ undefined() }}"
dev_vm_bazelrc_src: bazelrc
dev_vm_bazelisk_src: bazelisk
dev_vm_al_src: al
dev_vm_selinux_android_emulation: true
dev_vm_android_sdk_root: "{{ dev_vm_bazel_home }}/Android/Sdk"
dev_vm_android_installer_dir: "{{ dev_vm_bazel_home }}/.local/lib/android-installer"
dev_vm_android_installer_src: "{{ undefined() }}"
dev_vm_android_packages_src: "{{ undefined() }}"
dev_vm_android_install_timeout: 1800
7.2.10 - DNS
Setup dns records
7.2.10.1 - Defaults
Defaults for dns
dns_records: []
dns_domains: []
dns_njalla_api_url: https://njal.la/api/1/
dns_njalla_token:
7.2.11 - Docker
Setup docker
7.2.11.1 - Defaults
Defaults for docker
7.2.12 - Download host
Btrfs storage, SSH publication, and native static hosting
alwaldend.main.download_host configures download hosts using the existing
host, nginx, and traefik roles. It checks that the selected content device
is a block device before configuring the host, creates Btrfs without
forcing replacement of an existing filesystem, and mounts by UUID. This role
is intended for the Fedora hosts used by infra/download.
The role creates only the publication roots: projects/, third_party/, infra/, sites/, and private
staging/, owned by the download publisher account. Publishers create individual projects,
sites, and releases. The mount root and service state remain root-owned;
privileged ownership changes never traverse per-site directories. Shared Nginx
and Traefik roles own their service units. Traefik uses its standard system-disk
location. A daily systemd timer runs incremental duperemove over projects/, third_party/,
infra/, and sites/ with resource limits and private hash state. Uploading files,
extracting sites, and switching the current-release symlink are separate
publisher operations. Administrators authenticate with existing SSH access and
run publication as this account through sudo. The role does not manage its
authorized_keys and requires no publisher key input. It installs rsync for
SSH transfers.
On SELinux-enabled hosts, the role persists httpd_sys_content_t labels for
static content and applies them with restorecon. This permits confined Nginx
to read the custom document root; ordinary Unix permissions alone do not grant
that access. See Red Hat’s Nginx configuration guide.
Filesystem creation, UUID-based mounting, directories, SELinux labels, and daily
maintenance live in tasks/filesystem.yaml. The pinned
community.general.btrfs_info
module discovers filesystem UUIDs; selection uses the canonical device path so
both direct device paths and by-id symlinks work. Attachment checks remain in
tasks/main.yaml before base-host setup.
Caller contract
- Select target hosts through inventory or deployment wrapper limits and enable
privilege escalation. The role does not restrict play size.
- Set
force_handlers: true on the play so completed configuration changes run
their notified handlers even if a later task fails. - Supply
download_content_device. Administrator SSH and sudo access come
from the shared host roles; no dedicated upload key is configured. - Override
download_root and download_publisher as needed. The content mount
must be under root-owned, non-publisher-writable parent directories. - Keep Traefik configuration and data on the system disk (the shared role
defaults to
/opt/traefik) so content-disk failure does not stop the proxy. - Supply the shared roles’ configuration, including
nginx_config_template,
Traefik static/dynamic templates, ACME settings, and base-host variables.
The caller owns inventory, firewall policy, Vault references, and routing.
- name: Configure the selected download VM
hosts: download
become: true
force_handlers: true
roles:
- alwaldend.main.download_host
The collection packages the role automatically through its existing role
aggregation. Domain-specific serving templates stay with the deployment.
Default configuration
The download_publication tag updates publication roots, read-only SELinux
labels, deduplication units and Nginx without provisioning storage or changing
other host services. It first requires the content root to be a mounted filesystem.
The content mount uses nofail and a ten-second device timeout, so an absent
content disk does not make it mandatory for OS boot. Nginx and deduplication
explicitly require the mount; SSH and Traefik remain on the system disk for
recovery. Missing storage still fails an attempted role deployment. This does
not provide content replication, backup, or automatic recovery of a lost disk.
7.2.12.1 - Defaults
Defaults for download_host
# Persistent Btrfs content mount and its non-sudo content owner.
download_root: /srv/download
download_publisher: download
# Required: the content block device. Administrators publish via sudo.
download_content_device: "{{ undefined() }}"
7.2.13 - Facts
Setup ansible facts
7.2.13.1 - Defaults
Defaults for facts
7.2.14 - Filesystem
Setup filesystems
7.2.14.1 - Defaults
Defaults for filesystem
7.2.15 - Firewall
Setup firewall
The role installs incoming and routed allows, deletes explicitly retired rules,
and enables UFW. All rule operations use community.general.ufw. Rule comments
are descriptive and do not determine which rules are deleted.
For an enabled policy, the role enables and starts ufw.service before
updating rules. This restores an existing policy after reboot even when an
older deployment left the service disabled. Firewalld is stopped first because
its service conflicts with UFW. The role also masks firewalld when its package
is absent, so later dependency installation cannot enable the conflicting
service. A disabled policy also disables UFW startup.
Declare retired rules in firewall_delete_rules, which defaults to an empty
list. Removing an entry from firewall_allow_port_from or
firewall_allow_forward alone leaves its installed rule in place. Add a matching
deletion entry and retain it for hosts that may have missed earlier deployments.
Unlisted rules remain; the role does not reset the firewall.
Each deletion requires rule (allow, deny, reject, or limit) and accepts
the module’s name, proto, port, from_port, src, dest, direction, and
route parameters. Sources and destinations default to any; route defaults
to false. Omitted protocol, port, direction, and application parameters retain
the module defaults. Match the original rule specification, including any
destination or routing constraint. Application profiles use name without
proto or port.
firewall_delete_rules:
- rule: allow
port: "8080"
proto: tcp
- rule: allow
name: mDNS
dest: 224.0.0.251
- rule: allow
route: true
src: 192.0.2.0/24
dest: 198.51.100.0/24
Install replacement management access in firewall_allow_port_from before
retiring an SSH profile; desired allows run before deletions. Do not also declare
a retired rule as a desired allow. The download consumer declares TCP 22 and
explicitly retires inherited SSH and mDNS profile rules, including the IPv4
and IPv6 multicast destinations.
7.2.15.1 - Defaults
Defaults for firewall
firewall_state: enabled
firewall_enabled: true
firewall_allow_port_from: []
firewall_allow_forward: []
# Explicit UFW rule specifications to delete after desired allows are installed.
firewall_delete_rules: []
7.2.16 - Forgejo
Forgejo installation and controlled local SQLite upgrades
The role manages Forgejo’s executable, configuration and systemd unit. When
startup contents change, it stages the candidate, drains and stops the old
service, archives the declared files, installs and starts the candidate, then
checks HTTP health, the running version and database consistency. Unchanged
runs repair file ownership and modes without restarting or archiving.
Declare the deployment layout
This workflow supports a local SQLite database, local storage and an HTTP
backend, including HTTP behind a separately managed TLS proxy. Set
forgejo_database_path to the SQLite file used by the configuration template;
it defaults to {{ forgejo_work_dir }}/data/forgejo.db.
forgejo_backup_paths is the complete archive contract. Defaults cover
forgejo_dir, the configuration, executable and unit. Add every external local
storage directory and referenced secret file, including symlink targets, an
external Git home, LFS/package storage or token files. The role checks declared
inputs and managed state/startup coverage before an activation. It does not
scan trees for symlinks or discover paths from INI settings. Keep the existing configuration’s persistence paths stable;
coordinate relocation and external-database/storage backups separately.
Use absolute file-backed secret references across releases.
Paths must be literal normalized absolute paths. Recovery storage defaults to
/var/backups/forgejo and must be outside the archive inputs. Declared paths
pass directly to tar, preserving case-distinct and overlapping roots. The host
must provide GNU realpath, GNU tar and gzip. Before activation, separation
is checked after resolving symlinks, including a not-yet-created recovery directory.
Existing inputs and the configured SQLite file must exist before an upgrade.
Partial installations and downgrades fail before stopping.
The supplied template owns the SQLite/HTTP layout. The role uses the existing
INI filter only to reject changes to SECRET_KEY or SECRET_KEY_URI.
Key bindings must be literal values; interpolated %(...)s expressions are
rejected before downtime rather than resolved by the upgrade role.
Candidate execution is checked once on the managed host. Changed inputs are
staged before this check; unchanged runs inspect the installed executable.
The role manages the account and acl, git, git-lfs packages by default.
Callers disabling forgejo_manage_user or forgejo_manage_packages supply those
prerequisites. ACL support is needed for unprivileged Ansible module execution.
Serialize upgrades per instance. Check mode cannot verify this transaction.
Set forgejo_custom_header_local_path to a controller-side Forgejo template
file. The role installs it under forgejo_work_dir/custom/templates/custom/header.tmpl
through the guarded activation workflow. The file contents are copied literally.
An empty source path leaves the installed header unmanaged.
Optional SSH commit-signing pair
Set forgejo_signing_ssh_key to a dictionary with private_key and public_key
strings to install a dedicated Ed25519 pair before service activation. It defaults
to an empty dictionary. The caller owns secure generation and storage and must
supply Git 2.34+ and OpenSSH ssh-keygen 8.2p1+ on the managed host. Configure
the service template with FORMAT = ssh and
SIGNING_KEY = {{ forgejo_dir }}/signing/instance.pub, plus its signing identity.
The role validates the pair, installs private/public files with modes 0600/0644
under a service-owned 0700 directory, and rejects different existing private
content. Matching reruns repair metadata and public content without restarting.
The files remain under forgejo_dir and its existing backup coverage. The role
does not generate, rotate, or publish keys. Secret-bearing tasks suppress output;
their temporary candidate is removed even on validation failure.
Recovery
Every changed existing installation retains a private recovery directory with
snapshot.tar.gz and manifest.json. Directories use mode 0700; archives and
manifests use 0600. They remain on the managed host and contain secrets.
Provision sufficient space and independent disaster-recovery backups; retention
cleanup is an operator responsibility.
If draining fails, the old instance stays running. If preparation or archiving
fails before startup-file replacement, an intact previously active service is
restarted. After replacement begins, failed acceptance leaves the candidate
stopped. There is no automatic downgrade against potentially migrated data.
A pending.json marker blocks retries until explicit recovery or a deliberate
corrected retry; it is removed only after successful acceptance.
To restore, stop Forgejo, verify the selected archive/checksum, and move aside
its candidate data trees. Extract the complete archive into / (the manifest’s
archive_root), preserving numeric ownership and permissions. The archive
contains the directory roots and their metadata; no separate reconstruction
step is needed.
Restore the old executable, configuration and unit together with their data,
reload systemd and start that version. Verify service and application behavior
before removing the pending marker. Restoration can discard later writes and
requires explicit operator authorization.
Verification
bazel test //projects/ansible_collection/test/forgejo_upgrade:upgrade_test
runs actual Forgejo 15.0.3 and 17.0.1 with disposable SQLite state and a bounded
service-manager fixture. It checks upgrade/restore, unchanged runs, explicit
backup validation and failure recovery. Sanitized JSON results are retained;
fixture credentials and archives are discarded. The signing case verifies a real
API-generated commit with the installed SSH pair and checks unchanged runs and
private-key mismatch refusal. Real systemd, cross-account SSH and production
data are outside this rehearsal.
7.2.16.1 - Defaults
Defaults for forgejo
forgejo_user: forgejo
forgejo_group: "{{ forgejo_user }}"
forgejo_owner: root
forgejo_manage_packages: true
forgejo_manage_user: true
forgejo_signing_ssh_key: {}
forgejo_user_uid: 5157
forgejo_dir: "/opt/forgejo"
forgejo_data_dir: "{{ forgejo_dir }}/data"
forgejo_config_dir: "{{ forgejo_dir }}/configs"
forgejo_work_dir: "{{ forgejo_dir }}/work"
forgejo_custom_header_local_path: ""
forgejo_config_path: "{{ forgejo_config_dir }}/forgejo.ini"
forgejo_config_local_path: "files/forgejo.ini"
forgejo_disk:
forgejo_log_dir: "{{ forgejo_dir }}/logs"
forgejo_service_path: "/lib/systemd/system/forgejo.service"
forgejo_vault_local_path: "{{ role_path }}/files/vault"
forgejo_bin_local_path: "{{ role_path }}/files/forgejo"
forgejo_bin_path: /usr/bin/forgejo
forgejo_database_path: "{{ forgejo_work_dir }}/data/forgejo.db"
forgejo_backup_dir: /var/backups/forgejo
forgejo_backup_paths:
- "{{ forgejo_dir }}"
- "{{ forgejo_config_path }}"
- "{{ forgejo_bin_path }}"
- "{{ forgejo_service_path }}"
forgejo_queue_timeout: 120s
forgejo_health_url: http://127.0.0.1:3000
forgejo_health_retries: 60
forgejo_health_delay: 2
7.2.17.1 - Defaults
Defaults for threexui
threexui_user: threexui
threexui_user_uid: 6468
threexui_dir: "/opt/threexui"
threexui_data_dir: "{{ threexui_dir }}/data"
threexui_work_dir: "{{ threexui_dir }}/work"
threexui_disk:
threexui_log_dir: "{{ threexui_dir }}/logs"
threexui_service_path: "/lib/systemd/system/threexui.service"
threexui_vault_local_path: "{{ role_path }}/files/vault"
threexui_bin_dir: "{{ threexui_dir }}/bin"
threexui_bin_local_dir: "{{ role_path }}/files/threexui_bin"
threexui_config_dir: "{{ threexui_dir }}/configs"
threexui_env_path: "{{ threexui_config_dir }}/threexui.env"
threexui_env_override: {}
threexui_base_path: /
threexui_username: "{{ undefined() }}"
threexui_password: "{{ undefined() }}"
threexui_port: "2053"
threexui_debug: "false"
threexui_env:
# https://docs.sanaei.dev/docs/reference/env-vars/
XUI_DB_TYPE: sqlite
XUI_DB_FOLDER: "{{ threexui_data_dir }}"
XUI_PORT: "{{ threexui_port }}"
XUI_INIT_WEB_BASE_PATH: "{{ threexui_base_path }}"
XUI_ENABLE_FAIL2BAN: "true"
XUI_SKIP_HSTS: "true"
XUI_LOG_LEVEL: info
XUI_DEBUG: "{{ threexui_debug }}"
XUI_LOG_FOLDER: "{{ threexui_log_dir }}"
XUI_BIN_FOLDER: "{{ threexui_bin_dir }}/bin"
XRAY_VMESS_AEAD_FORCED: "false"
XUI_ACCESS_URL: "https://{{ inventory_hostname }}{{ threexui_base_path }}"
XUI_USERNAME: "{{ threexui_username }}"
XUI_PASSWORD: "{{ threexui_password }}"
7.2.18 - Forgejo runner
Install and register a Forgejo Actions runner
Installs the repository-pinned Linux x86-64 Forgejo runner, creates its service
account, registers it once, and manages forgejo-runner.service. Set
forgejo_runner_dir to choose the installation directory (default
/opt/forgejo-runner). It contains the root-owned forgejo-runner executable
and config.yaml, and runner-owned home/ and work/ directories. The unit
is installed in /etc/systemd/system. Registration and the daemon use the
same configuration and work/.runner file.
Supply forgejo_runner_instance and forgejo_runner_token for initial
registration. forgejo_runner_name defaults to the inventory hostname. The
deployment supplies the token through its existing Vault injection flow; the
role passes it through stdin with logging suppressed and a bounded registration
deadline. Neither the worker nor this role performs Vault or OIDC login.
Once work/.runner exists, deployment needs no registration token or instance
input. That file contains the worker credentials and is restricted to mode
0600. Changing labels or capacity updates the
daemon configuration; changing a registered runner’s instance or identity
requires deliberate re-registration.
For an identity already created through Forgejo’s API, supply
forgejo_runner_credentials with id, uuid, token, instance and name.
The instance and name must match the role’s configured values. The role installs
this identity only when work/.runner is absent, with secret logging suppressed;
it does not register another worker or overwrite existing credentials.
forgejo_runner_labels and forgejo_runner_capacity control job selection and
concurrency. forgejo_runner_config supplies advanced settings using upstream
YAML keys. Its default mapping is shown in defaults.
Replacing it replaces that mapping; unspecified upstream settings use the
runner’s defaults. The role always sets runner.file, runner.labels,
runner.capacity and host.workdir_parent to match its own inputs.
For example, to change the job timeout and enable the cache:
forgejo_runner_config:
log:
level: info
job_level: info
runner:
timeout: 4h
shutdown_timeout: 30s
insecure: false
cache:
enabled: true
Set forgejo_runner_install_packages: false when the calling deployment supplies
all runner packages, including on RPM-OSTree hosts.
Node.js is required for JavaScript actions such as checkout.
The acl package must be available for Ansible to execute registration as the
unprivileged runner account; the role includes it in its package defaults.
Complete any required reboot before starting this role. Container runtime
installation and configuration remain the caller’s responsibility; Podman is
not installed for the default host executor. The default installation
and service paths are writable on OSTree hosts.
Host executor labels run jobs as the runner account without job isolation.
Restrict registration to trusted repositories and keep deployment credentials
out of the runner environment. The role does not grant sudo access. The Actions
cache service is disabled by default; enable it only after configuring its
network reachability. Configuration, binary, and service changes trigger a
handler to reload systemd and restart the runner.
Callers that install build tools into the runner’s home can import install
first and service after their prerequisites. The normal role entry point runs
both phases. Installation defers restarts; the service phase marks prerequisites
ready and flushes pending handlers. If prerequisite setup fails, forced handlers
leave a fresh worker stopped.
Registration failures produce a fixed message. Check initial inputs,
connectivity, TLS trust and Ansible’s ability to switch to the runner account;
keep secret-bearing command output suppressed.
Older path overrides are replaced by forgejo_runner_dir, preserving the
default layout. Migrate forgejo_runner_timeout and
forgejo_runner_shutdown_timeout to runner.timeout and
runner.shutdown_timeout under forgejo_runner_config, and
forgejo_runner_cache_enabled to cache.enabled. The service stop deadline
remains forgejo_runner_service_stop_timeout; keep it longer than the configured
runner shutdown timeout.
The local acceptance fixture exercises
registration and renders both templates without deploying a worker.
7.2.18.1 - Defaults
Defaults for forgejo_runner
---
forgejo_runner_user: forgejo-runner
forgejo_runner_user_uid: 5721
forgejo_runner_dir: /opt/forgejo-runner
forgejo_runner_install_packages: true
forgejo_runner_packages:
- acl
- git
- nodejs
forgejo_runner_instance: "{{ undefined() }}"
forgejo_runner_token: "{{ undefined() }}"
forgejo_runner_credentials: {}
forgejo_runner_name: "{{ inventory_hostname }}"
forgejo_runner_labels:
- "self-hosted:host"
forgejo_runner_capacity: 1
forgejo_runner_service_stop_timeout: 60s
forgejo_runner_registration_timeout: 120
forgejo_runner_config:
log:
level: info
job_level: info
runner:
timeout: 3h
shutdown_timeout: 30s
insecure: false
cache:
enabled: false
7.2.19.1 - Defaults
Defaults for gpg
7.2.20 - Grafana role
Run alwaldend.main.grafana with privilege escalation on Fedora. The role
installs the Fedora Grafana package, stores data in the RPM’s SQLite
directory, listens on loopback, and checks database health after starting
the systemd service. Set grafana_hostname to the HTTPS hostname served by
the reverse proxy.
Supply the local recovery password, encryption key, and OIDC client secret
as files on the Ansible controller. Set the OIDC client ID, browser
authorization URL, token URL, UserInfo URL, and administrator group.
Members of that OIDC group receive Grafana server administrator access.
The role enables PKCE and keeps the local login available for recovery.
Set grafana_feature_toggles to enable deployment-specific Grafana features.
7.2.20.1 - Defaults
Defaults for grafana
grafana_hostname: "{{ undef() }}"
grafana_http_port: 3000
grafana_feature_toggles: []
grafana_admin_password_src: "{{ undef() }}"
grafana_secret_key_src: "{{ undef() }}"
grafana_oidc_client_id: "{{ undef() }}"
grafana_oidc_client_secret_src: "{{ undef() }}"
grafana_oidc_auth_url: "{{ undef() }}"
grafana_oidc_token_url: "{{ undef() }}"
grafana_oidc_userinfo_url: "{{ undef() }}"
grafana_oidc_name: OIDC
grafana_oidc_scopes: openid profile email groups
grafana_oidc_login_attribute: preferred_username
grafana_oidc_admin_group: "{{ undef() }}"
7.2.21 - Harboer
Harbor
Links
7.2.21.1 - Defaults
Defaults for harbor
harbor_user: harbor
harbor_user_uid: 7049
harbor_dir: "/opt/harbor"
harbor_installer_dir: "{{ harbor_dir }}/installer"
harbor_logs_dir: "{{ harbor_dir }}/logs"
harbor_data_dir: "{{ harbor_dir }}/data"
harbor_installer_local_dir: "{{ role_path }}/files/harbor_installer"
harbor_config_path: "{{ harbor_installer_dir }}/harbor.yml"
harbor_config_local_path: "files/harbor.yaml"
harbor_domain: "{{ undefined() }}"
harbor_ca_local_path: "{{ role_path }}/files/pki_ca_servers.crt"
harbor_ca_path: /etc/docker/certs.d/{{ harbor_domain }}/ca.crt
harbor_root_ca_local_path: "{{ role_path }}/files/pki_ca_root.crt"
7.2.22 - Hermes
Install and run the Hermes Agent gateway
7.2.22.1 - Defaults
Defaults for hermes
hermes_user: hermes
hermes_user_uid: 8150
hermes_dir: /opt/hermes
hermes_home_dir: "{{ hermes_dir }}/home"
hermes_install_dir: "{{ hermes_dir }}/hermes-agent"
hermes_disk:
hermes_port: 8642
hermes_commit: "{{ undefined() }}"
hermes_installer_local_path: "{{ role_path }}/files/install.sh"
hermes_installer_path: "{{ hermes_dir }}/install.sh"
hermes_config_local_path: "files/hermes.yaml"
hermes_config_path: "{{ hermes_home_dir }}/.hermes/config.yaml"
hermes_env_path: "{{ hermes_home_dir }}/.hermes/.env"
hermes_env: {}
hermes_bin_path: "{{ hermes_home_dir }}/.local/bin/hermes"
hermes_dashboard_service_path: /lib/systemd/system/hermes-dashboard.service
7.2.23 - Hiddify manager
Setup hiddify manager
7.2.23.1 - Defaults
Defaults for hiddify_manager
hiddify_manager_env:
HIDDIFY_MANAGER_IMAGE: ghcr.io/hiddify/hiddify-manager:main@sha256:d5edef06d2133ffa26f0fcbb67e711f4356dba44c44a41a96570c4e03845a84c
HIDDIFY_MANAGER_REDIS_IMAGE: redis:7.4.1@sha256:bb142a9c18ac18a16713c1491d779697b4e107c22a97266616099d288237ef47
HIDDIFY_MANAGER_MARIADB_IMAGE: mariadb:11.6.2@sha256:a9547599cd87d7242435aea6fda22a9d83e2c06d16c658ef70d2868b3d3f6a80
HIDDIFY_MANAGER_REDIS_PASSWORD: "{{ lookup('ansible.builtin.env', 'HIDDIFY_MANAGER_REDIS_PASSWORD', default=undef()) }}"
HIDDIFY_MANAGER_MYSQL_PASSWORD: "{{ lookup('ansible.builtin.env', 'HIDDIFY_MANAGER_MYSQL_PASSWORD', default=undef()) }}"
HIDDIFY_MANAGER_MARIADB_PASSWORD: "{{ lookup('ansible.builtin.env', 'HIDDIFY_MANAGER_MARIADB_PASSWORD', default=undef()) }}"
hiddify_manager_env_override: {}
hiddify_manager_dir: /opt/hiddify_manager
7.2.24 - Hiddify manager with host
Setup host and then hiddify manager
7.2.24.1 - Defaults
Defaults for hiddify_manager_host
7.2.25 - Host
Common host setup
Common setup invokes update_all_packages once for immediate package updates
and native automatic-update configuration. Set
update_all_packages_automatic_enabled: true
to enable native security-update timers, or staged image updates on OSTree.
Automatic reboots are disabled. Immediate reboots also default to disabled;
update_all_packages_reboot_enabled: true explicitly permits a required reboot.
7.2.25.1 - Defaults
Defaults for host
7.2.26 - Install CA
Install a certificate authority
7.2.26.1 - Defaults
Defaults for install_ca
install_ca:
- path: "{{ role_path }}/files/pki_ca_root.crt"
- path: "{{ role_path }}/files/pki_ca_servers.crt"
7.2.27 - K3s
Setup k3s
Set k3s_manifests_local_path, k3s_auth_config_local_path, or
k3s_admission_config_local_path to an empty string to omit that file during
bootstrap.
Set k3s_server_ca_vault_path to a Vault KV v2 API path such as
secrets/data/example/kubernetes_ca to publish the public server CA after
K3s starts. The controller uses the injected Vault connection and credentials.
The role stores server-ca.crt as certificate and writes a new version
only when the certificate changes. An empty path disables publication.
7.2.27.1 - Defaults
Defaults for k3s
k3s_data_dir: /srv/k3s_data
k3s_service_name: k3s
k3s_data_disk: /dev/sdb
k3s_storage_dir: /srv/k3s_storage
k3s_storage_disk: /dev/sdc
k3s_config_path: "/etc/rancher/k3s/config.yaml"
k3s_config_local_path: "files/k3s.yaml"
k3s_admission_config_path: "/etc/rancher/k3s/admission.yaml"
k3s_admission_config_local_path: "files/k3s_admission.yaml"
k3s_auth_config_path: "{{ [(k3s_config_path | dirname), 'k3s_auth.yaml'] | path_join }}"
k3s_auth_config_local_path: "files/k3s_auth.yaml"
k3s_manifests_local_path: "files/k3s_manifests.yaml"
k3s_manifests_path: "{{ k3s_data_dir }}/server/manifests/k3s-manifests.yaml"
k3s_bin_local_path: "{{ role_path }}/files/k3s"
k3s_bin_path: /usr/local/bin/k3s
k3s_install_script_local_path: "{{ role_path }}/files/k3s_install"
k3s_install_script_path: /usr/local/bin/k3s_install
k3s_server_ca_vault_path: ""
7.2.28 - K3s bootstrap
Bootstrap k3s cluster
The role declares Python and uv as host packages, creates its Kubernetes virtual
environment with uv venv, and installs the Python client with uv pip install.
The environment is created only when its interpreter is missing; package installs
report changes only when uv installs or removes distributions. These operations
run during an explicitly authorized role deployment and require package-index
access. Repository validation builds and renders the role without deploying it.
7.2.28.1 - Defaults
Defaults for k3s_bootstrap
k3s_bootstrap_apply_path:
k3s_bootstrap_token_name: "{{ lookup('ansible.builtin.env', 'USER', default=undef()) }}"
k3s_bootstrap_token_namespace: kube-system
k3s_bootstrap_venv_dir: "/opt/bootstrap-venv"
k3s_bootstrap_venv_bin: "{{ k3s_bootstrap_venv_dir | mandatory }}/bin/python"
k3s_bootstrap_kubeconfig: /etc/rancher/k3s/k3s.yaml
k3s_bootstrap_cluster_name: "{{ inventory_hostname }}"
k3s_bootstrap_cluster_ca_path: "{{ lookup('ansible.builtin.env', 'HOME', default=undef()) }}/.kube/ca-{{ k3s_bootstrap_cluster_name | mandatory }}.ca.crt"
k3s_bootstrap_user_ca_path: "{{ k3s_bootstrap_cluster_ca_path | mandatory | dirname }}/ca-{{ k3s_bootstrap_cluster_name | mandatory }}-{{ k3s_bootstrap_token_name | mandatory }}.ca.crt"
k3s_bootstrap_user_name: "{{ k3s_bootstrap_cluster_name | mandatory }}-{{ k3s_bootstrap_token_name | mandatory }}"
k3s_bootstrap_cluster_port:
7.2.29 - K3s cluster
Setup k3s cluster
7.2.29.1 - Defaults
Defaults for k3s_cluster
7.2.30 - K3s kubeconfig
Write k3s kubeconfig to a secret
7.2.30.1 - Defaults
Defaults for k3s_kubeconfig
k3s_kubeconfig_secret_path: "{{ undefined() }}"
k3s_kubeconfig_secret_mount: "{{ undefined() }}"
k3s_kubeconfig_path: /etc/rancher/k3s/k3s.yaml
k3s_kubeconfig_vault_bin_local_path: "{{ role_path }}/files/vault"
7.2.31 - llama.cpp
Installs caller-supplied, Bazel-verified llama.cpp and CUDA archives on Linux
x86-64, verifies and stages a GGUF, and manages a loopback-only systemd server.
The caller owns archive pins and packaging, driver provisioning, and GPU/image
requirements. No runtime archive or model is downloaded by this role.
Supply llama_archive_src, llama_cuda_archive_src, an absolute controller-side
llama_model_src, and llama_model_sha256. Both runtime archives must have one
top-level directory; extraction strips that level and places the libraries
beside llama-server. The role verifies shared-library resolution and CUDA device
discovery before starting inference. It creates a separate non-login account,
keeps the runtime administrator-owned, and makes the model group-readable.
Changed inputs notify a restart; readiness follows pending restarts. Repeated
unarchive comparison repairs interrupted extraction and preserves unchanged
installations. The role contains no Codex provider or Responses bridge logic.
7.2.31.1 - Defaults
Defaults for llama
llama_user: llama
llama_uid: 1101
llama_home: /var/lib/llama
llama_runtime_dir: /opt/llama/runtime
llama_archive_src: "{{ undefined() }}"
llama_cuda_archive_src: "{{ undefined() }}"
llama_model_src: "{{ undefined() }}"
llama_model_sha256: "{{ undefined() }}"
llama_model_path: "{{ llama_home }}/model.gguf"
llama_model_alias: model
llama_context_size: 32768
llama_port: 8080
llama_device: CUDA0
llama_service_path: /etc/systemd/system/llama-server.service
7.2.32 - lvg
Setup LVM volume groups
lvg_volume_groups describes the complete desired physical-volume list for
each volume group. Extra physical volumes are not removed unless a caller sets
remove_extra_pvs: true.
Creating a volume group initializes every listed device as an LVM physical
volume. Callers must resolve stable device paths and verify that each device is
the intended, unused disk before applying this role; pvcreate may overwrite
an existing disk signature.
7.2.32.1 - Defaults
Defaults for lvg
7.2.33 - lvol
Setup LVM logical volumes
Each lvol_volumes entry can constrain allocation with pvs, pass creation
arguments with opts, and disable shrinking with shrink: false.
7.2.33.1 - Defaults
Defaults for lvol
7.2.34 - Lynis audit
Bounded on-demand security audit with private controller reports
alwaldend.main.lynis_audit extracts the packaged CISOfy source archive into a
root-owned 0700 temporary directory and runs an audit as root.
The Linux target must have a POSIX shell, tar, GNU timeout, and a remote Python
version supported by the packaged Ansible runtime. The role requires privilege
escalation to root and does not support Ansible check mode. It does not install
Python or provide a legacy transport fallback.
Supply lynis_audit_archive as the controller path to the archive packaged from
//third_party/com_github_cisofy_lynis:archive. Supply
lynis_audit_report_directory as an existing absolute controller directory,
owned by the controller user with mode 0700. In repository operations, place it
under the task’s ignored out/ directory. lynis_audit_timeout_seconds defaults
to 900, with a further 15-second termination grace period and a maximum of 3600.
Each invocation creates a unique 0700 result directory and exposes its path as
lynis_audit_result_directory. It retains 0600 console.log, lynis.log,
lynis-report.dat, and result.json files. The role writes an incomplete receipt
first, then records the remote scratch recovery path before preparing or running
the scanner. The receipt and lynis_audit_exit_code record the scanner status;
the exit code remains null when command execution supplies none. Transport and
collection errors are retained in the private receipt, without exposing their
contents through Ansible output.
The audit runs through native Ansible async polling, with its job data under
the private audit directory. A finished result supplies the scanner return code;
missing, unreachable or unfinished results supply none. This separates scanner
status from the SSH polling process without an encoded stdout protocol.
The console is still redirected to a private file, preserving partial output.
Completion requires exit 0 (without warnings) or 78 (with warnings), successful
retention of all existing evidence, and a fully fetched report containing
finish=true and a positive integer lynis_tests_done. An accepted exit alone
does not establish completion. Other statuses, unfinished or zero-test reports,
and collection failures fail the role after available evidence is collected.
Timeout statuses 124 or 137 indicate incomplete evidence; available partial
artifacts are retained. Empty files can indicate failure before scanner output.
The command retains audit system with all test groups and --cronjob. In the
pinned source, --quick only skips input pauses; it does not select fewer tests.
--cronjob already enables that behavior and noninteractive handling of an
existing scanner PID file, so a separate --quick is redundant. It does not
install a cron job. Individual checks still depend on host applicability and
the profile exclusions below.
The command uses the extracted source and profiles through --usecwd, disables
plugins, uploads, and scanner update checks, and disables package repository
refreshes. The packaged source contains no runnable plugins, only a plugin
template and its README. The shared profile also skips DNF/YUM checks that can
mutate caches independently of refresh-repositories=no:
PKGS-7350: installed-package inventory through DNF.PKGS-7352: DNF security-update advisories and vulnerable-package reporting.PKGS-7354: DNF package-database integrity checks.PKGS-7383: YUM repository/package-update management checks.PKGS-7384: YUM utilities, duplicate packages, and package-database problems.PKGS-7386: YUM security support and missing security-update checks.PKGS-7387: enabled YUM repositories’ GPG-signature configuration.
Consequently, this audit omits those DNF/YUM package inventory, security advisory,
database, repository, and signature checks; other applicable package checks can
still run. Package maintenance belongs to the caller’s dedicated workflow.
Normal system and DNS checks remain enabled; this is not an offline sandbox.
The role installs no package, service, schedule, or automatic remediation.
Lynis assesses system hardening and does not establish absence of compromise.
The pinned include/tests_malware primarily checks for installed security tools
and related processes; it does not run a comprehensive antivirus or rootkit
scan. A completed audit therefore does not certify the host free of malware.
Lynis itself creates private /tmp/lynis.* files and /var/run/lynis.pid, which
its normal exit handler removes. A forced termination can leave these behind.
The role removes its allocated remote directory only after all evidence paths
have been inspected, every existing evidence file has been fetched successfully,
the collection receipt has been saved, and terminal scanner status is known.
This permits cleanup after a failed or timed-out scan when its partial artifacts
were retained. A stat or fetch
failure leaves the remote directory in place and fails the role; consult
result.json for the private remote_directory recovery path and diagnostics.
The recorded path may already be absent after successful collection and cleanup.
An unreachable host or interrupted controller can prevent collection or cleanup;
the initial receipt and recorded recovery path survive. The role never removes
an existing scanner’s PID or temporary files. Reports contain host details and
should remain private.
7.2.34.1 - Defaults
Defaults for lynis_audit
# Controller path to the packaged //third_party/com_github_cisofy_lynis:archive.
lynis_audit_archive: "{{ undefined() }}"
# Existing absolute controller directory, owned by its user with mode 0700.
lynis_audit_report_directory: "{{ undefined() }}"
# GNU timeout terminates the process group, with a further 15-second kill grace.
lynis_audit_timeout_seconds: 900
7.2.35 - MLflow
MLflow tracking service and Vast.ai job coordinator
alwaldend.main.mlflow installs a caller-supplied runtime archive and enables
the MLflow tracking service and Vast.ai coordinator on a Linux systemd host.
Run it with privilege escalation. The services listen on loopback and keep
their data in /var/lib/mlflow-tracking and /var/lib/mlflow-vastai.
Supply mlflow_runtime_archive as a controller-side path to a tar archive with
mlflow, its runfiles, and mlflow-vastai at the archive root. The role
extracts each archive revision into its own directory and activates it at
/opt/mlflow/current.
Set mlflow_tracking_uri to the authenticated URL used by clients and workers.
The runtime archive must include the MLflow OIDC plugin and a coordinator
that supports a bearer-token file. Supply the OIDC provider registry,
permitted groups, client secret file, session signing key file, and coordinator token
file. The coordinator also needs its Vast.ai API key, allowed rentals, SSH
identity, and verified host keys. The caller configures the HTTPS reverse
proxy and prepares the workers.
When the caller provides dedicated volumes, set mlflow_require_data_mounts
to true and mount them before invoking the role. Tracking then requires
mounts at /var/lib/mlflow-tracking and /var/lib/mlflow-tracking/artifacts.
The coordinator requires a mount at /var/lib/mlflow-vastai.
Set mlflow_enable_coordinator to false to install tracking independently.
Provide only the browser OIDC registry entries in this mode. The role skips
coordinator setup and leaves any previously installed coordinator untouched.
7.2.35.1 - Defaults
Defaults for mlflow
# Controller-side archive containing the MLflow CLI, its runfiles, and mlflow-vastai.
mlflow_runtime_archive: "{{ undef() }}"
# Tracking URL reachable by the coordinator, project submitters, and workers.
mlflow_tracking_uri: "{{ undef() }}"
mlflow_hostname: "{{ mlflow_tracking_uri | urlsplit('hostname') }}"
mlflow_tracking_port: 5000
mlflow_coordinator_port: 50051
mlflow_enable_coordinator: true
# Require separate mounts at the tracking, artifacts, and coordinator state paths.
mlflow_require_data_mounts: false
# Override the package name for distributions that package OpenSSH differently.
mlflow_ssh_client_package: openssh-clients
mlflow_worker_user: root
# The allowed rental selectors are supplied as one comma-separated string.
mlflow_vastai_workers: "{{ undef() }}"
mlflow_vast_api_key: "{{ undef() }}"
mlflow_tracking_token_src: "{{ undef() }}"
mlflow_oidc_providers: "{{ undef() }}"
mlflow_oidc_client_secret_src: "{{ undef() }}"
mlflow_oidc_session_key_src: "{{ undef() }}"
mlflow_oidc_groups: "{{ undef() }}"
mlflow_oidc_admin_groups: []
# Controller-side paths to the coordinator's SSH identity and trusted host keys.
mlflow_worker_ssh_key: "{{ undef() }}"
mlflow_worker_known_hosts: "{{ undef() }}"
7.2.36 - Mount
Setup posix mounts
Mount entries can set opts, dump, and passno; state: mounted keeps the
mount active and writes its persistent /etc/fstab entry.
7.2.36.1 - Defaults
Defaults for mount
7.2.37 - Nginx
Native Nginx with validated consumer configuration
Installs Fedora’s nginx package and manages its native systemd service.
The consumer supplies a complete nginx_config_template, including listeners,
HTTP settings, MIME includes, and document roots. Replacing the main config
also removes package-default virtual hosts from the active configuration.
Ansible renders and validates the entire candidate with nginx -t -c before
atomically replacing nginx_config_path. Invalid candidates leave the prior
configuration and running service intact. Valid changes notify a reload;
an unchanged run does not restart or reload Nginx. The role never manages
published content. Packages can be caller-managed with
nginx_manage_packages: false.
The download component owns its routes, storage permissions, SELinux labels,
and the Traefik TLS frontend. The role validation record
links the consumer fixture and lifecycle results.
nginx_requires_mounts_for defaults to an empty list. When configured, the role
writes a systemd RequiresMountsFor override and reloads unit definitions.
Content services therefore wait for their required mounts and cannot start
against an unmounted directory. Keep these paths administrator-owned.
7.2.37.1 - Defaults
Defaults for nginx
# Complete configuration template owned by the consumer.
nginx_config_template: "{{ undefined() }}"
nginx_config_path: /etc/nginx/nginx.conf
nginx_binary: /usr/sbin/nginx
nginx_manage_packages: true
nginx_packages:
- nginx
nginx_service_name: nginx
# Mounts required before starting the content service.
nginx_requires_mounts_for: []
7.2.38 - OpenCanary role
Installs OpenCanary in a Python virtual environment on Fedora and runs it as
an unprivileged systemd service. Set opencanary_services to a mapping of
module names to port and protocol pairs. Enable the optional audited,
read-only Samba decoy with opencanary_smb_enabled.
When HTTPS is enabled, set opencanary_https_sign_path to a Vault PKI signing
endpoint to maintain the HTTPS certificate with the
Vault server certificate role.
Use the opencanary_tls tag to check or renew it on an existing host.
Events go to the system journal. Only supply an address range the guest is
intended to monitor when permitting inbound access to decoy ports.
7.2.38.1 - Defaults
Defaults for opencanary
opencanary_version: "0.9.10"
opencanary_services:
http: {port: 80, proto: tcp}
opencanary_smb_enabled: false
opencanary_https_certificate: /var/lib/opencanary/https.pem
opencanary_https_key: /var/lib/opencanary/https.key
opencanary_https_sign_path: ""
7.2.39 - Opencode
Opencode
7.2.39.1 - Defaults
Defaults for opencode
opencode_user: opencode
opencode_user_uid: 8149
opencode_dir: "/opt/opencode"
opencode_port: 4096
opencode_domain: "{{ undefined() }}"
opencode_log_dir: "{{ opencode_dir }}/logs"
opencode_work_dir: "{{ opencode_dir }}/work"
opencode_home_dir: "{{ opencode_dir }}/home"
opencode_config_dir: "{{ opencode_home_dir }}/.config/opencode"
opencode_config_path: "{{ opencode_config_dir }}/opencode.json"
opencode_config_local_path: "files/opencode.json"
opencode_disk:
opencode_service_path: "/lib/systemd/system/opencode.service"
opencode_bin_local_path: "{{ role_path }}/files/opencode"
opencode_bin_path: /usr/bin/opencode
opencode_env_path: "{{ opencode_config_dir }}/opencode.env"
opencode_env_override: {}
opencode_ssh_public_key: "{{ undefined() }}"
opencode_ssh_private_key: "{{ undefined() }}"
opencode_server_username: "{{ undefined() }}"
opencode_server_password: "{{ undefined() }}"
opencode_env:
OPENCODE_SERVER_USERNAME: "{{ opencode_server_username }}"
OPENCODE_SERVER_PASSWORD: "{{ opencode_server_password }}"
7.2.40 - OpenHands automation
OpenHands automation server
Runs the OpenHands automation server natively from a uv-managed virtual
environment. It stores schedules and event triggers, tracks run lifecycle, and
dispatches conversations to the agent server.
The automation server is not a sandbox. It records which agent server should
run a dispatched conversation and hands that work to
AUTOMATION_AGENT_SERVER_URL; setting that variable selects the agent
server’s local mode, which uses a persistent local agent server instead of
managed OpenHands Cloud sandboxes.
openhands_automation_agent_server_api_key must equal the agent server’s
session API key because both services authenticate the same
X-Session-API-Key value. openhands_automation_local_api_key is the key
browsers present to this service.
The service stores state in SQLite via AUTOMATION_DB_URL by default, which
local mode supports without a separate database role. Set
openhands_automation_database_url to a PostgreSQL URL to use one instead.
openhands_automation_kv_secret enables the automation key-value store and is
required for automations that persist state between runs.
openhands_automation_base_url is the externally reachable origin the service
appends /api/automation to when it builds callback URLs, so it must be the
origin the browser and the dispatched agent server side both use.
7.2.40.1 - Defaults
Defaults for openhands_automation
openhands_automation_user: openhands
openhands_automation_user_uid: 8154
openhands_automation_dir: /opt/openhands-automation
openhands_automation_home_dir: "{{ openhands_automation_dir }}/home"
openhands_automation_work_dir: "{{ openhands_automation_dir }}/work"
openhands_automation_state_dir: "{{ openhands_automation_dir }}/state"
openhands_automation_disk:
openhands_automation_packages:
- python3.12
- uv
openhands_automation_host: 127.0.0.1
openhands_automation_port: 18001
openhands_automation_version: "{{ undefined() }}"
openhands_automation_agent_server_version: "{{ undefined() }}"
openhands_automation_agent_server_url: "{{ undefined() }}"
openhands_automation_sandbox_agent_server_url: ""
openhands_automation_agent_server_api_key: "{{ undefined() }}"
openhands_automation_base_url: "{{ undefined() }}"
openhands_automation_local_api_key: "{{ undefined() }}"
openhands_automation_kv_secret: "{{ undefined() }}"
openhands_automation_database_url: "sqlite+aiosqlite:///{{ openhands_automation_state_dir }}/automations.db"
openhands_automation_workspace_base: "{{ openhands_automation_work_dir }}/automations"
openhands_automation_venv_dir: "{{ openhands_automation_dir }}/venv"
openhands_automation_service_path: /lib/systemd/system/openhands-automation.service
openhands_automation_env_path: "{{ openhands_automation_dir }}/.env"
openhands_automation_env:
PYTHONUTF8: "1"
OPENHANDS_REMOTE_WS_READY_REQUIRED: "false"
OPENHANDS_SUPPRESS_BANNER: "1"
openhands_automation_env_override: {}
7.2.41 - OpenHands canvas
OpenHands Agent Canvas frontend
Runs the OpenHands Agent Canvas browser client from the published npm package.
The service listens on loopback port openhands_canvas_port; TLS, the public
hostname, and routing to the agent server and automation API belong to the
deployment’s Traefik role.
The service runs the package’s scripts/static-server.mjs directly with Node,
an explicit loopback host, and the package’s build/ directory. It serves the
browser client without starting an agent server, an automation server, or the
npm launcher’s additional ingress process. Agent Canvas owns no conversation
or automation state and executes no tools.
The browser starts with no configured backend. The operator adds one with the
canvas origin as the host and the agent server’s session key as the credential.
The static server receives no session key and injects none into served assets.
This configuration does not advertise an embedded VSCode editor.
The npm prefix is installed inside openhands_canvas_dir.
openhands_canvas_package_dir identifies the installed package containing the
static server and browser assets.
7.2.41.1 - Defaults
Defaults for openhands_canvas
openhands_canvas_user: openhands
openhands_canvas_user_uid: 8153
openhands_canvas_dir: /opt/openhands-canvas
openhands_canvas_home_dir: "{{ openhands_canvas_dir }}/home"
openhands_canvas_work_dir: "{{ openhands_canvas_dir }}/work"
openhands_canvas_state_dir: "{{ openhands_canvas_dir }}/state"
openhands_canvas_package_dir: "{{ openhands_canvas_dir }}/lib/node_modules/@openhands/agent-canvas"
openhands_canvas_disk:
openhands_canvas_packages:
- nodejs24
- nodejs24-npm
openhands_canvas_host: 127.0.0.1
openhands_canvas_port: 8000
openhands_canvas_version: "{{ undefined() }}"
openhands_canvas_service_path: /lib/systemd/system/openhands-canvas.service
openhands_canvas_env_path: "{{ openhands_canvas_dir }}/.env"
openhands_canvas_env:
NODE_ENV: production
openhands_canvas_env_override: {}
7.2.42 - Openhands server
OpenHands agent server
Runs the OpenHands agent server natively from a uv-managed virtual
environment. It hosts conversations, executes tools, and streams events for
Agent Canvas. The service binds loopback only; TLS and external reachability
belong to the calling deployment.
Set openhands_server_secure to true to require a session API key. The
unsecured mode omits the session key and is only appropriate where the loopback
boundary is trusted.
The caller can set openhands_server_install_packages to false and install
openhands_server_packages through its host-specific package workflow.
OSTree hosts use the shared dev_vm package entry point and must boot into a
deployment containing those dependencies before installing the service. They
also set openhands_server_service_path under /etc/systemd/system.
7.2.42.1 - Defaults
Defaults for openhands_server
openhands_server_user: openhands
openhands_server_user_uid: 8152
openhands_server_dir: /opt/openhands-server
openhands_server_home_dir: "{{ openhands_server_dir }}/home"
openhands_server_work_dir: "{{ openhands_server_dir }}/work"
openhands_server_state_dir: "{{ openhands_server_dir }}/state"
openhands_server_conversations_dir: "{{ openhands_server_state_dir }}/conversations"
openhands_server_persistence_dir: "{{ openhands_server_state_dir }}/persistence"
openhands_server_workspace_dir: "{{ openhands_server_work_dir }}/project"
openhands_server_bash_events_dir: "{{ openhands_server_state_dir }}/bash_events"
openhands_server_tools_dir: "{{ openhands_server_dir }}/tools"
openhands_server_disk:
openhands_server_secure: true
openhands_server_install_packages: true
openhands_server_packages:
- python3.12
- uv
openhands_server_host: 127.0.0.1
openhands_server_port: 18000
openhands_server_version: "{{ undefined() }}"
openhands_server_session_api_key: "{{ undefined() }}"
openhands_server_secret_key: "{{ undefined() }}"
openhands_server_import_modules: canvas_ui_tool
openhands_server_vscode_port: 8001
openhands_server_vscode_base_path: /vscode
openhands_server_venv_dir: "{{ openhands_server_dir }}/venv"
openhands_server_venv_python: "{{ openhands_server_venv_dir }}/bin/python"
openhands_server_service_path: /lib/systemd/system/openhands-server.service
openhands_server_env_path: "{{ openhands_server_dir }}/.env"
openhands_server_env:
LOG_JSON: "true"
PYTHONUTF8: "1"
OPENHANDS_REMOTE_WS_READY_REQUIRED: "false"
OH_PERSISTENCE_DIR: "{{ openhands_server_persistence_dir }}"
OH_CONVERSATIONS_PATH: "{{ openhands_server_conversations_dir }}"
OH_WORKSPACE_PATH: "{{ openhands_server_workspace_dir }}"
OH_BASH_EVENTS_DIR: "{{ openhands_server_bash_events_dir }}"
OH_SECRET_KEY: "{{ openhands_server_secret_key }}"
7.2.43 - OS
Common os setup
7.2.43.1 - Defaults
Defaults for os
os_hardening_enabled: true
7.2.44 - Posgresql
Setup Postgresql
7.2.44.1 - Defaults
Defaults for postgresql
postgresql_packages:
- postgresql-server
- postgresql-contrib
postgresql_service: postgresql
7.2.45 - Pve
Proxmox Virtual Environment deploy
Links
7.2.45.1 - Defaults
Defaults for pve
pve_repo_keyring_path: /usr/share/keyrings/proxmox-archive-keyring.gpg
pve_repo_path: /etc/apt/sources.list.d/pve-install-repo.sources
pve_repo_keyring_url: https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg
pve_repo_keyring_checksum: "sha256:136673be77aba35dcce385b28737689ad64fd785a797e57897589aed08db6e45"
pve_snippets_dir: /var/lib/vz/snippets
pve_snippets: []
pve_repo_content: |
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: {{ pve_repo_keyring_path }}
7.2.46 - PVE cluster
Setup PVE cluster
7.2.46.1 - Defaults
Defaults for pve_cluster
pve_cluster_remove_repos:
- pve-enterprise.list
- ceph.list
pve_cluster_add_repos:
- name: pve-no-subscription
value: deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
- name: ceph-squid
value: deb http://download.proxmox.com/debian/ceph-squid bookworm no-subscription
pve_cluster_node_config: []
pve_cluster_admins: []
pve_cluster_cluster_name:
pve_cluster_acme_accounts: []
pve_cluster_acme_plugins: []
pve_cluster_venv_dir: /opt/ansible/pve_cluster_venv
pve_cluster_venv_packages:
- pexpect
pve_cluster_base_image_dir: /var/lib/vz/template
pve_cluster_node_name: "{{ inventory_hostname | mandatory | split('.') | first }}"
pve_cluster_ceph_enabled: false
pve_cluster_ceph_repository: no-subscription
pve_cluster_ceph_osd: []
pve_cluster_ceph_pools: []
pve_cluster_ceph_mon: []
pve_cluster_ceph_mgr: []
pve_cluster_ceph_mds: []
pve_cluster_storages: []
pve_cluster_storage_config_path: /etc/pve/storage.cfg
7.2.47 - PVE VM
Setup PVE VM
7.2.47.1 - Defaults
Defaults for pve_vm
pve_vm_agent:
pve_vm_name: "{{ inventory_hostname }}"
pve_vm_delegate_update_known_hosts: localhost
pve_vm_delegate_pve:
pve_vm_set: "{{ pve_vm_set_default + pve_vm_set_additional }}"
pve_vm_set_default: []
pve_vm_set_additional: []
pve_vm_set_creation: "{{ pve_vm_set_creation_default + pve_vm_set_creation_additional }}"
pve_vm_set_creation_default: []
pve_vm_set_creation_additional: []
pve_vm_resize: []
pve_vm_venv_dir: "/opt/ansible/pve_vm_venv"
pve_vm_init_user:
pve_vm_venv_packages:
- proxmoxer
- requests
7.2.48 - PVE VM remove
Remove PVE VM
7.2.48.1 - Defaults
Defaults for pve_vm_remove
7.2.49 - Raspberry pi
Setup raspberry pi
7.2.49.1 - Defaults
Defaults for raspberry_pi
raspberry_pi_argon_enabled: false
raspberry_pi_containers_enabled: false
raspberry_pi_argon_eeprom_script_path: /usr/local/bin/argon_argon_eeprom.sh
raspberry_pi_argon_argon1_script_path: /usr/local/bin/argon_argon1.sh
raspberry_pi_cmdline_path: /boot/firmware/cmdline.txt
7.2.50 - Socket proxy
Activate a TCP proxy on demand with systemd
The socket listens on socket_proxy_listen and starts an unprivileged
systemd-socket-proxyd service when a client connects. The service forwards
the byte stream to socket_proxy_target. Supply both endpoints as addresses
with ports and set socket_proxy_name to the systemd unit basename.
The caller owns firewall policy and backend readiness.
Set socket_proxy_selinux_allow_http_ports on hosts that need the socket
proxy to bind or connect to TCP ports labeled http_port_t. The role
installs the policy before starting the socket on SELinux-enabled hosts.
The policy also lets systemd transition the unprivileged service into the
socket proxy domain with NoNewPrivileges enabled.
7.2.50.1 - Defaults
Defaults for socket_proxy
socket_proxy_name: "{{ undefined() }}"
socket_proxy_listen: "{{ undefined() }}"
socket_proxy_target: "{{ undefined() }}"
socket_proxy_selinux_allow_http_ports: false
7.2.51 - SSH
Setup ssh
Normal setup installs fail2ban, installs the trusted user CA, creates missing
RSA, ECDSA and Ed25519 host keys, discovers and signs them, and invokes
devsec.hardening.ssh_hardening with those signed
certificate paths. The upstream role retains its native tasks and restart
handler.
Key creation preserves existing private keys. ssh_host_keys_dir defaults to
/etc/ssh and controls creation, discovery and upstream hardening. New RSA keys
use ssh_host_rsa_key_size (4096 bits by default), matching the hardening policy
before certificates are issued. The ssh_host_keys tag selects key creation
alone; upstream hardening retains its existing key-strength policy.
The ssh_hardening_match_user default supplies Match User ansible with
AllowTcpForwarding remote, PermitListen none, and
AllowStreamLocalForwarding remote through the upstream template. Set
ssh_hardening_match_user: [] to omit this match, or replace the list with
custom entries. The wrapper explicitly maps this variable to upstream
ssh_server_match_user; use the wrapper variable for inventory overrides.
Select normal SSH setup through the owning deployment’s ssh tag and an
explicit host limit, for example:
bazel run //infra/ingress/ansible:ansible -- \
--limit host1.ingress.alwaldend.com --tags ssh
This uses the owner’s authentication and runs the full SSH setup described
above, including the native restart handler. The ssh_hardening tag alone
skips the required certificate discovery. The upstream template validates its
candidate during apply; --check --diff previews do not validate the proposed
configuration. The scanner does not invoke this role or change server policy.
Replacing a signed host certificate notifies a role-owned handler. It runs
sshd -t before reloading the daemon so new connections receive the renewed
certificate even when the hardening configuration is unchanged. The service
name follows sshd_service_name when provided, otherwise the OS-family default.
Existing sessions survive the reload. This is deployment-time renewal; the role
does not install a certificate renewal timer.
7.2.51.1 - Defaults
Defaults for ssh
ssh_hardening_enabled: true
ssh_host_keys_dir: /etc/ssh
ssh_host_rsa_key_size: 4096
# Set to [] to omit the shared Match User default.
ssh_hardening_match_user:
- user: ansible
rules:
- AllowTcpForwarding remote
- PermitListen none
- AllowStreamLocalForwarding remote
ssh_vault_mount: ssh/servers
ssh_vault_role: "{{ undefined }}"
ssh_sign_ignore_errors: false
ssh_valid_principals: []
7.2.52 - SSH port forwarding
Setup SSH port forwarding
7.2.52.1 - Defaults
Defaults for ssh_port_forward
ssh_port_forward_local_addr: 127.0.0.1
ssh_port_forward_script_path: /usr/local/bin/ssh-port-forward
7.2.53 - SSH update known hosts
Update known hosts
7.2.53.1 - Defaults
Defaults for ssh_update_known_hosts
ssh_update_known_hosts_hosts: []
7.2.54 - T3 Code
Run the T3 Code server as a systemd service
The default npm installation mode retains the npm launcher. Callers can
select t3code_install_method: standalone and supply t3code_archive_src,
a controller-side archive whose integrity is verified by the caller’s Bazel
repository. The role transfers the archive without downloading it on the host. The role installs the complete official bundle under an
administrator-owned release directory and invokes its executable directly.
State, work, and home remain owned by the ordinary T3 service account.
Archive comparison repairs missing or incomplete bundle files on reapplication;
the existence of the executable alone does not skip extraction.
Standalone mode uses native T3 pairing/session authentication and omits the
legacy npm mode’s T3CODE_AUTH_TOKEN environment entry.
Changed runtime, environment, or service inputs restart T3 Code. An unchanged
run ensures the service is started. Token-bearing environment writes are
excluded from Ansible logs. Optional t3code_initial_settings seeds first
startup without overwriting later UI settings. Deployment and provider setup
remain the caller’s responsibility.
7.2.54.1 - Defaults
Defaults for t3code
t3code_user: t3code
t3code_user_uid: 8151
t3code_dir: /opt/t3code
t3code_home_dir: "{{ t3code_dir }}/home"
t3code_work_dir: "{{ t3code_dir }}/work"
t3code_disk:
t3code_port: 5120
t3code_version: "{{ undefined() }}"
t3code_state_dir: "{{ t3code_dir }}/state"
t3code_auth_token: "{{ undefined() }}"
t3code_service_path: /lib/systemd/system/t3code.service
t3code_env_path: "{{ t3code_dir }}/.env"
t3code_env: {}
t3code_install_method: npm
t3code_archive_src: "{{ undefined() }}"
t3code_release_dir: "{{ t3code_dir }}/releases/standalone"
t3code_bin_path: "{{ t3code_release_dir }}/t3"
t3code_initial_settings: {}
7.2.55 - Traefik
Traefik
The administrator owns the proxy directory, configurations, TLS inputs, binary,
and unit. The service account can write only its data and log directories;
custom configuration and executable paths must have administrator-owned
ancestors and stay outside those writable directories. Static configuration
can contain credentials and is installed with mode 0640.
Both rendered configurations pass controller-side TOML/YAML syntax validation
before installation. Startup inputs (static configuration, binary, trust CA,
Basic Auth verifier, and unit) restart the service only when changed. Dynamic routing uses Traefik’s
file watcher. Unchanged runs keep the process running; the unit has no SIGHUP
reload action. Syntax validation does not prove route semantics or external
issuer reachability.
Installation retains temporary backups. If staging or startup fails, available
prior files are restored and a previously active service is restarted before
the play reports failure. A first installation has no previous deployment to
restore. Failed recovery preserves its backups; successful activation or
recovery removes them. This covers startup rejection, not failures after a
successful startup or invalid dynamic routing accepted by the process.
Local ACME enrollment is cached in administrator-only eab.json (mode 0600).
The Vault request runs on the controller without privilege escalation; cache
installation runs on the managed host with its declared administrator ownership.
Unchanged deployments reuse it without issuing another Vault request. The first
upgrade creates the cache once. Changing the issuer path or setting
traefik_rotate_eab: true requests a new binding; reset the flag afterwards.
If the ACME account state is lost, rotate its single-use enrollment binding
before re-enrolling. Keep the cache and ACME account data private.
Basic Auth
Set traefik_basic_auth_src to the controller-side verifier file and use
traefik_basic_auth_path as usersFile in the dynamic configuration. The
role installs the verifier with mode 0640 and restores it with the other
startup inputs if activation fails.
Prometheus metrics
Configure the Prometheus entry point in the deployment’s static Traefik
configuration. Use the role’s default metrics port, 9100, and configure the
host firewall to allow the collector.
7.2.55.1 - Defaults
Defaults for traefik
traefik_user: traefik
traefik_no_user: false
traefik_owner: root
traefik_user_uid: 3578
traefik_dir: "/opt/traefik"
traefik_log_dir: "{{ traefik_dir }}/logs"
traefik_data_dir: "{{ traefik_dir }}/data"
traefik_tls_dir: "{{ traefik_dir }}/tls"
traefik_basic_auth_src: null
traefik_basic_auth_path: "{{ traefik_tls_dir }}/basic-auth.htpasswd"
traefik_disk:
traefik_mtls_ca_local_path: "{{ role_path }}/files/traefik_mtls_ca.crt"
traefik_mtls_ca_path: "{{ traefik_tls_dir }}/mtls_ca.crt"
traefik_acme_path: "{{ undefined }}"
traefik_config_dir: "{{ traefik_dir }}/configs"
traefik_config_path: "{{ traefik_config_dir }}/traefik.toml"
traefik_disable_eab: false
traefik_config_local_path: "files/traefik.toml"
traefik_dynamic_config_path: "{{ traefik_config_dir }}/traefik_dynamic.toml"
traefik_dynamic_config_local_path: "files/traefik_dynamic.toml"
traefik_service_path: "/lib/systemd/system/traefik.service"
traefik_service_scope: system
traefik_bin_local_path: "{{ role_path }}/files/traefik"
traefik_bin_path: /usr/bin/traefik
traefik_vault_bin_local_path: "{{ role_path }}/files/vault"
traefik_eab_cache_path: "{{ traefik_config_dir }}/eab.json"
# Rotate explicitly after losing an ACME account or its enrollment state.
traefik_rotate_eab: false
traefik_metrics_port: 9100
7.2.56 - Traefik (old)
Old traefik role
7.2.56.1 - Defaults
Defaults for traefik_old
traefik_user: traefik
traefik_user_uid: 3653
traefik_env: {}
traefik_data_dir: /mnt/traefik
traefik_log_dir: "/var/log/traefik"
traefik_certificates_dir: "{{ traefik_data_dir }}/certificates"
traefik_configs_dir: "{{ traefik_data_dir }}/configs"
traefik_configs_version: "{{ lookup('ansible.builtin.pipe', 'git rev-parse HEAD') }}"
traefik_configs_dynamic_dir: "{{ traefik_configs_cur_dir }}/dynamic"
traefik_configs_dynamic_dir_symlink: "{{ traefik_configs_symlink }}/dynamic"
traefik_configs_cur_dir_name: "{{ traefik_configs_version }}"
traefik_configs_cur_dir: "{{ traefik_configs_dir }}/{{ traefik_configs_cur_dir_name }}"
traefik_configs_symlink: "{{ traefik_configs_dir }}/current"
traefik_static_config_path: "{{ traefik_configs_symlink }}/traefik.yaml"
traefik_releases_dir: /opt/traefik/releases
traefik_static_config:
traefik_dynamic_configs: []
traefik_release_version: v3.3.1
traefik_release_dir_name: "{{ traefik_release_version }}"
traefik_release_dir: "{{ traefik_releases_dir }}/{{ traefik_release_dir_name }}"
traefik_release_symlink: "{{ traefik_releases_dir }}/current"
traefik_release_symlink_bin: "{{ traefik_release_symlink }}/traefik"
traefik_release_archive_name: "traefik_{{ traefik_release_version }}_linux_amd64"
traefik_release_archive_full: "traefik_{{ traefik_release_version }}_linux_amd64.tar.gz"
traefik_release_bin_path: "{{ traefik_release_dir }}/traefik"
traefik_release_download_url: "https://github.com/traefik/traefik/releases/download/{{ traefik_release_version }}/{{ traefik_release_archive_full }}"
traefik_release_download_checksum: sha256:27fd502a8d80fc81b97faf5cebd7a1cbc1a2c5369d18e0f4471a66d1a8c139ce
7.2.57 - Update all packages
Update all system packages
This role owns immediate package updates and native automatic updates. The
shared host role imports it once.
Immediate updates refresh metadata and update installed packages on modern
systemd DNF4, DNF5 and APT hosts. APT refuses transactions requiring package
removal. Holds, exclusions, repository choices and version locks remain in
effect. Package-manager Python bindings must already be installed; automatic
binding installation is disabled for APT and DNF5. Legacy appliances such as
XCP-ng require their owning maintenance workflow.
The /run/ostree-booted marker takes precedence over DNF facts. OSTree upgrades
use the pinned ansible.posix.rpm_ostree_upgrade module to prepare a deployment
for the next boot, without live application. Prepared fixes are not necessarily
active until a later authorized reboot.
An already running native staging transaction is allowed to finish before the
immediate upgrade starts; the role waits for up to 30 minutes and never cancels it.
update_all_packages_upgrade_enabled defaults to true. Set it to false
to use the normal role for automatic-update configuration only; immediate
upgrades, reboot detection, and the explicit reboot task are skipped.update_all_packages_reboot_enabled: false is the default. A reboot occurs
only when explicitly enabled and the backend reports it is required.update_all_packages_automatic_enabled defaults to true. Set it to false
to disable native automatic updates. It never enables automatic reboots.- The
update_all_packages tag runs the complete role. - The
automatic_updates tag configures native automation without an immediate
upgrade or reboot.
Use the normal role entry point with these controls. Backend selection happens
once; task files are internal implementation and are not standalone APIs.
Reboot detection uses dnf needs-restarting -r, dnf5 needs-restarting, the
Debian /var/run/reboot-required marker, or the first OSTree deployment’s boot
state. update_all_packages_reboot_required records the result. DNF exit codes
0 and 1 mean no reboot and reboot required; other failures remain failures.
The native DNF reboot-hint command must already be installed.
Native automatic updates
The role uses native packages (dnf-automatic,
dnf5-plugin-automatic, unattended-upgrades), configuration paths and systemd
timers. DNF selects security advisories; APT retains its packaged allowed
origins. No custom timer or cron job is created. Other vendor settings remain
intact. Disabling automatic updates stops and disables installed native
installation timers without installing a missing updater package. DNF opt-out
covers the generic DNF4 timer, its install-only variant, and the DNF5 timer,
including timers left behind when the selected updater package is absent.
Native download-only and notification timers remain unchanged. Already running
update services are allowed to finish; stopping a timer does not cancel a transaction.
OSTree uses AutomaticUpdatePolicy=stage and
rpm-ostreed-automatic.timer, retaining other daemon settings. Changed policy
is reloaded before the timer is enabled. Disabling sets policy none and stops
the timer. This backend stages complete deployments, not security-only updates.
DNF reboot=never and APT Automatic-Reboot=false are explicit. Before enabling
timers, the role inspects native service commands and systemd actions for
separate reboot/shutdown hooks, including Cockpit overrides, and fails with an
actionable message when found. It does not replace unrelated administrator
overrides or cancel a previously scheduled reboot. Arbitrary external automation
still requires a host audit. Package scripts may restart services even when
host reboots are disabled.
Inspect the native timer state, effective configuration, update service journal,
pending packages/deployments and unchanged-run results during E2E verification.
Enabling a timer proves scheduling, not a successful future transaction.
7.2.57.1 - Defaults
Defaults for update_all_packages
# Reboot only when explicitly enabled and the backend reports it is required.
update_all_packages_reboot_enabled: false
# Allow configuration-only callers to use the normal role entrypoint.
update_all_packages_upgrade_enabled: true
# Enable native automatic security updates by default (staged updates on OSTree).
# This never enables automatic reboots, even when immediate reboots are enabled.
update_all_packages_automatic_enabled: true
7.2.58 - Users
Setup system users
7.2.58.1 - Defaults
Defaults for users
users_regular: {}
users_remove: {}
users_admins:
ansible:
name: ansible
disable_passwd: true
sudo_no_passwd: true
users_ssh_keys: {}
7.2.59 - Vault
Setup Hashicorp Vault
7.2.59.1 - Defaults
Defaults for vault
vault_user: vault
vault_time_server: time.cloudflare.com
vault_user_uid: 3123
vault_dir: "/opt/vault"
vault_data_dir: "{{ vault_dir }}/data"
vault_raft_dir: "{{ vault_dir }}/raft"
vault_config_dir: "{{ vault_dir }}/configs"
vault_config_path: "{{ vault_config_dir }}/vault.hcl"
vault_config_local_path: "files/vault.hcl"
vault_log_dir: "{{ vault_dir }}/logs"
vault_tls_dir: "{{ vault_dir }}/tls"
vault_service_path: "/lib/systemd/system/vault.service"
vault_tls_client_ca_file_local_path: files/tls_client_ca_file.pem
vault_tls_client_ca_file_path: "{{ vault_tls_dir }}/tls_client_ca_file.pem"
vault_tls_cert_file_path: "{{ vault_tls_dir }}/tls_cert_file.pem"
vault_tls_key_file_path: "{{ vault_tls_dir }}/tls_key_file.pem"
vault_tls_issue_path:
vault_tls_alt_names: ""
vault_bin_local_path: "{{ role_path }}/files/vault"
vault_bin_path: /usr/bin/vault
vault_peers_write: false
vault_peers_local_path:
vault_peers_remote_path: "{{ vault_raft_dir }}/raft/peers.json"
7.2.60 - Vault server certificate
Use alwaldend.main.vault_server_certificate to obtain a certificate from
Vault PKI for a managed host’s existing private key. The role retains a trusted
certificate for the configured name while it has at least seven days remaining.
When renewal is needed, the role sends a signing request to Vault from the
Ansible controller, verifies the returned certificate, and installs it on the
host. The private key stays on the managed host.
Supply the Vault PKI signing path, certificate path, private key path, and
service group. The role uses the play’s date_time fact, the host’s CA trust,
and the Vault connection and token injected on the controller. Set
vault_server_certificate_notify to a handler when the service needs to reload
or restart after a certificate change.
7.2.60.1 - Defaults
Defaults for vault_server_certificate
vault_server_certificate_sign_path: "{{ undefined() }}"
vault_server_certificate_path: "{{ undefined() }}"
vault_server_certificate_key_path: "{{ undefined() }}"
vault_server_certificate_group: "{{ undefined() }}"
vault_server_certificate_name: "{{ inventory_hostname }}"
vault_server_certificate_ttl: 720h
vault_server_certificate_notify: []
7.2.61 - VictoriaMetrics role
The alwaldend.main.victoria_metrics role installs and configures the
VictoriaMetrics single-node service on a systemd host. Run it with privilege
escalation and set victoria_metrics_binary_src to the executable path on
the Ansible controller.
Set victoria_metrics_dashboard_src to a VMUI dashboard JSON file on the
controller to enable a predefined dashboard. VMUI reads the installed JSON
when its dashboard view loads, so edits to the JSON take effect on reload.
The service binds to loopback and retains data for 30 days. To configure
scrape jobs, set victoria_metrics_scrape_config_src to a YAML template on
the Ansible controller.
7.2.61.1 - Defaults
Defaults for victoria_metrics
victoria_metrics_binary_src: "{{ undefined() }}"
victoria_metrics_dashboard_src: ""
victoria_metrics_scrape_config_src: scrape.yaml.j2
7.2.62 - Wireguard
Setup wireguard
7.2.62.1 - Defaults
Defaults for wireguard
wireguard_dir: "/etc/wireguard"
wireguard_local_config_paths: []
7.2.63 - Xray
Setup xray
Links:
7.2.63.1 - Defaults
Defaults for xray
xray_enabled: false
xray_config_dir: /usr/local/etc/xray
xray_log_dir: /var/log/xray
xray_config_path: "{{ xray_config_dir }}/0-main.json"
xray_client_id:
xray_wireguard_relays: []
xray_wireguard_ipv4_address:
xray_wireguard_ipv6_address:
xray_wireguard_private_key:
xray_config:
xray_configs: {}
xray_user: xray
xray_socket_dir: /var/shm/xray
xray_caddy_config_path: /etc/caddy/configs/xray.Caddyfile
xray_subscriptions_dir: /usr/local/etc/xray-subscriptions
xray_caddy_user: caddy
8 - Autoscroll
Mouse-driven autoscroll CLI with reloadable configuration
Autoscroll is a Python and PyQt6 command-line application that turns mouse
movement into horizontal and vertical scrolling. It supports configurable
buttons, scroll speed, and configuration changes without restarting.
Links
Features
- Platfrom-independent autoscroll
- Config file with hot-reload
- Some argparse tinkering
- Python3, PyQt6
Usage
By default, the icon is disabled, to enable it pass --icon-enable
You can pass file contents as command line arguments using @path/to/the/file syntax.
Arguments in that case can be placed wherever - on one line, on several lines
If you want to dynamically pass runtime arguments (without restarting the process), you can use --config options for it
Once you press --buttons-start, you can scroll vertically or horizontally just by moving your mouse untill you press --buttons-end
If --buttons-hold is set, the srolling ends once you release --buttons-start
Once --buttons-start is pressed, the scroll thread starts looping
Every loop consists of sleeping for an interval, then scrolling for either 0, 1, or -1 pixels on both axis towards the starting point
Starting point is the point where --buttons-start was pressed
Sleep interval is recalculated on every mouse move as such:
100 / (--scrolling-acceleration * max(distance) + --scrolling-speed)
If --scrolling-acceleration is not 0, the speed of scrolling will be faster
the farther away you are from the starting point
If --scrolling-acceleration is 0, the speed of scrolling will be constant
Examples
Use the package
uv venv venv
. venv/bin/activate
uv pip install autoscroll
autoscroll
Repository Python dependencies use the shared uv locking workflow.
Dependencies are declared in pyproject.toml and locked in uv.lock.
Update the native lock with //projects/autoscroll:uv_lock.update and
review its diff. Build //projects/autoscroll:uv_lock to generate it
without source writes.
The sandboxed resolution action requires network access to PyPI.
The uv configuration resolves macOS and non-macOS environments separately.
Their union covers every platform, while the resulting package resolution
markers let Bazel’s native importer retain PyObjC for the macOS backend and
omit it on Linux and Windows. Keep both complementary environments when
updating the lock.
Command line options
autoscroll --buttons-start 1 --debug-click --icon-disable
Pass a configuration file once
autoscroll --icon-enable @config.txt
If config.txt is defined like this, its contents will be used as command line arguments - they will be loaded only once
Arguments can be placed wherever - on one line, on several lines
For example,
--buttons-start 1
--buttons-hold --debug-click
Listen for changes in the configuration file
autoscroll --config-enable --config-path config.txt
If config.txt is defined like this, the process will listen for changes in that
file and update itself
Arguments can be placed wherever - on one line, on several lines
The file is checked for changess every --config-interval
For example:
--buttons-start 1 --buttons-hold
--debug_click
--help output
usage: autoscroll [-h] [-ss SCROLLING_SPEED] [-sd SCROLLING_DEAD_AREA]
[-sa SCROLLING_ACCELERATION] [-bh] [-bs BUTTONS_START] [-be BUTTONS_END]
[-ce] [-cp CONFIG_PATH] [-ci CONFIG_INTERVAL] [-ie] [-ip ICON_PATH]
[-is ICON_SIZE] [-df] [-dc] [-ds] [-di]
...
options:
-h, --help show this help message and exit
scrolling:
-ss, --scrolling-speed int
constant part of the scrolling speed
[default: 300]
-sd, --scrolling-dead-area int
size of the square area aroung the starting point where scrolling will stop, in
pixels
[default: 50]
-sa, --scrolling-acceleration int
dynamic part of the scrolling speed, depends on the distance from the point
where the scrolling started, can be set to 0
[default: 10]
buttons:
-bh, --buttons-hold if set, the scrolling will end once you release --buttons-start
-bs, --buttons-start int
button that starts the scrolling
[default: 2]
-be, --buttons-end int
button that ends the scrolling
[default: --buttons-start]
config:
-ce, --config-enable if set, arguments from the configuration file on --config-path will be loaded
every --config-interval
-cp, --config-path str
path to the configuration file
[default: ~/.config/autoscroll/config.txt]
-ci, --config-interval int
how often the config file should be checked for changes, in seconds
[default: 5]
icon:
-ie, --icon-enable if set, the icon will be enabled
-ip, --icon-path str path to the icon
[default: resources/img/icon.svg]
-is, --icon-size int size of the icon, in pixels
[default: 30]
debug:
-df, --debug-file if set, every time the config file is parsed, information will be printed to
stdout
-dc, --debug-click if set, click info will be printed to stdout
-ds, --debug-scroll if set, scroll info will be printed to stdout
-di, --debug-initial if set, startup configuration will be printed to stdout
9 - Bazel dependency analyzer
Bazel rules and a Go command for dependency graphs and Mermaid diagrams
Bazel dependency analyzer
Bazel rules and a Go command that analyze Bazel’s streamed JSON dependency
graph as individual targets or aggregated packages. Target analysis produces
deterministic Mermaid flowcharts and ownership mindmaps. Package analysis
produces Mermaid or JSON from one shared aggregate. Generated diagrams compose
with the repository’s existing SVG and WebP render rules.
Bazel rules
Load the macro in a BUILD file and choose a root target:
load("//projects/bazel_deps_analyzer:defs.bzl", "bazel_deps_mermaid")
load("//tools/mermaid:defs.bzl", "mermaid_webp")
bazel_deps_mermaid(
name = "dependencies",
target = ":application",
depth = 3,
)
mermaid_webp(
name = "dependencies_webp",
src = ":dependencies",
out = "dependencies.webp",
aspect_ratio = [],
)
The macro captures deps(target) with native genquery, following the pattern
in tools/bzl, then runs the converter in a sandbox. It never launches Bazel
inside an action. The capture is available as <name>.query.ndjson; the main
target produces <name>.mmd, or the path selected with out.
bazel_deps_mermaid_from_json accepts an existing capture through src, with
the complete target label supplied as root. It takes the same conversion
options as the target macro:
| Attribute | Default | Behavior |
|---|
depth | -1 | Maximum shortest-path dependency distance; -1 is unlimited and 0 shows the root only |
diagram_type | "flowchart" | Dependency flowchart or ownership mindmap inventory |
direction | "LR" | LR, RL, TB, or BT flowchart direction; ignored for mindmap |
include_files | False | Include source files and generated files |
include_external | False | Include external repository targets |
external_leaves | False | Show the first external targets as leaves and omit their dependencies |
group_by_package | False | Group short target names under full package names, nesting external packages by repository |
build_deps_only | False | Select explicit deps/srcs values using the capture contract below |
out | <name>.mmd | Generated Mermaid output path |
Command
Capture a graph and convert it independently:
bazel query 'deps(//projects/alwaldend.com:site, 3)' \
--output=streamed_jsonproto --implicit_deps --notool_deps --nonodep_deps \
> "$PWD/out/site-dependencies.ndjson"
bazel run //projects/bazel_deps_analyzer -- analyze target \
--input "$PWD/out/site-dependencies.ndjson" \
--output "$PWD/out/site-dependencies.mmd" \
--root //projects/alwaldend.com:site --depth 3
The bare command and bare analyze print help and exit successfully. Choose
analyze target for the existing target conversion or analyze package for
aggregation. Conversion flags belong to the selected command; previous
root-level invocations must insert analyze target. The Bazel target and
JSON-input rules select that subcommand automatically.
For analyze target, --input and --output default to - for standard input
and standard output. --root is required; --depth, --direction, --include-files, and
--include-external select the same behavior as their rule attributes.
Use --external-leaves (or external_leaves = True in a rule) to show the
first external target on each path without traversing its dependencies.
This option includes external targets without requiring --include-external;
when both are set, the leaf boundary applies. Both options default to false,
and --include-external alone retains its full external expansion behavior.
Use --group-by-package (or group_by_package = True in a rule) to label
package subgraphs with their full names and nodes with short target names.
All visible external targets belong to an External subgraph, including in
flat mode. With package grouping, it contains repository groups, which contain
their fully qualified package groups. This changes the
diagram’s presentation without changing its selected targets or edges.
Grouping defaults to false and composes with external_leaves and file filters.
Grouped diagrams select Mermaid’s ELK layout with network-simplex placement
and merged edge routes; the repository renderer already includes it. Flat
diagrams keep their existing layout. Direction remains explicit; inspect
package captions when changing it because incoming edges can cross titles in
top-to-bottom layouts. Neither layout setting removes nodes or dependency edges.
The command consumes the stream of JSON Target records emitted by
--output=streamed_jsonproto,
rather than aquery’s JSON action graph. Extra record metadata is ignored by default.
Empty, malformed, conflicting, or rootless input fails before an output file is
created. Records and edges are sorted, and repeated edges are deduplicated.
Package dependency graphs
analyze package constructs an overview from every record in one workspace’s
capture, including disconnected components. It needs no root target or
synthetic selection node. Each owner is a graph node, rather than a container
of target nodes.
bazel run //projects/bazel_deps_analyzer -- analyze package \
--input "$PWD/out/all-targets.ndjson" \
--output "$PWD/out/packages.mmd" --package-depth 1
--package-depth is a positive number of local package path segments and
defaults to one. For example, //tools/compiler/frontend:library belongs to
//tools at depth one, //tools/compiler at depth two, and
//tools/compiler/frontend at depth three or higher. Shorter package paths
remain intact. The main // package is captioned root; local //root and
//External remain distinct. All external repositories share one External
node at every depth. Package hierarchy depth is separate from dependency-hop
--depth, which belongs only to analyze target.
Files and external records are included by default. Set --include-files=false
or --include-external=false to exclude them and their incident edges. Nodes
report selected target counts and internal target-edge counts; internal edges
are not drawn as self-loops. Every distinct directed relationship between
selected groups is retained without edge captions. Reciprocal relationships
share a double-headed arrow by default; --merge-reciprocal=false keeps
separate arrows. Automatic ELK layout and edge routing are emitted by the
analyzer, with no manual node placement. --direction defaults to LR and
also accepts RL, TB, and BT.
Use --format=json to consume exactly the same constructed aggregate:
bazel run //projects/bazel_deps_analyzer -- analyze package \
--input "$PWD/out/all-targets.ndjson" \
--output "$PWD/out/packages.json" --package-depth 2 --format json
The JSON contract is:
groups: sorted by caption, each containing caption, targetCount,
internalEdges, and sorted normalized target labels in members.edges: sorted by source, then dependency. These are zero-based group
array indices; targetEdges counts the original distinct target edges.
Reciprocal directions are both present regardless of --merge-reciprocal.meta: packageDepth, selectedTargets, selectedEdges,
unresolvedReferences, includeFiles, and includeExternal. Selected edge
counts include both internal and inter-group target edges. Opt-in filtering
adds buildDepsOnly: true; that field is omitted by default.
Mermaid is the default format. JSON memberships let viewers use the analyzer’s
construction directly rather than implement a second ownership algorithm.
Both formats report distinct unresolved dependency labels from selected source
records. Missing records are omitted, not invented. Aggregate paths do not
establish target-level reachability, and the capture’s original query limits
still apply. Keep workspace captures separate: identical labels in separate
workspaces do not establish a shared target identity.
For a declared render pipeline, use the dedicated JSON-input rule:
load("//projects/bazel_deps_analyzer:defs.bzl", "bazel_deps_packages_from_json")
bazel_deps_packages_from_json(
name = "packages",
src = "all-targets.ndjson",
package_depth = 1,
)
This rule accepts direction, include_files, include_external,
merge_reciprocal, build_deps_only, and format with the command’s defaults. Its output is
<name>.mmd, or <name>.json for format = "json"; out overrides that path.
Feed the Mermaid output directly to the existing SVG or WebP render rules.
Explicit deps/srcs filtering
Both analyze target and analyze package accept --build-deps-only.
The capture macro and both JSON-input rules expose build_deps_only = False.
Enabling it keeps only explicitly specified dependency-label values from
attributes named deps or srcs, intersected with the captured ruleInput
labels. It excludes non-explicit, nodep, and aspect-owned attributes and
selector condition labels. Scalar/list labels, label dictionaries (values or
keys according to type), and every unconfigured selector alternative are
supported. String and output attributes contribute no dependencies.
This is a structural filter, not a complete semantic build classifier. It
omits ordinary tools, data, visibility, alias actual, exports, headers,
and custom dependency attributes even when they describe necessary build
inputs. A label also present in valid explicit deps/srcs remains selected.
Tool exclusion is performed by the required upstream --notool_deps query
flag, not inferred from attribute names, paths, or hidden target status.
Bazel’s collapsed ruleInput cannot prove per-attribute tool provenance: for
example, a tool-transition deps label also present in non-tool data can
survive the intersection. The format has no per-attribute transition metadata
that would resolve this ambiguity.
Generated-file → generating-rule edges remain as structural build-producer
links, including when the generating rule is reached through a hidden file.
Package-group and environment-group metadata edges are removed. Filtering
happens before target traversal/depth and package aggregation. Package mode
still selects every captured record, including disconnected metadata, tool,
runtime, and source-file nodes; it filters edges rather than classifying nodes.
Existing file/external display options still apply. Filtered Mermaid contains
%% build_deps_only=true; filtered package JSON adds meta.buildDepsOnly.
Disabled filtering preserves existing output and accepts older captures.
Filtered input requires a new capture with all these options:
bazel query 'deps(//projects/alwaldend.com:site, 3)' \
--output=streamed_jsonproto --consistent_labels \
--noimplicit_deps --notool_deps --nonodep_deps \
--proto:output_rule_attrs=name,deps,srcs --proto:default_values=true \
--proto:flatten_selects=false --proto:rule_inputs_and_outputs=true \
> "$PWD/out/site-build-dependencies.ndjson"
bazel run //projects/bazel_deps_analyzer -- analyze package \
--input "$PWD/out/site-build-dependencies.ndjson" \
--build-deps-only --format=json \
--output "$PWD/out/site-build-packages.json"
Every RULE must contain an attribute named name, even rules without deps or
srcs. Native Bazel emits that marker with the options above. Old flat captures,
including the previously saved full root capture, lack the marker and fail with
exact recapture guidance before output replacement. The marker alone cannot
prove query options: callers must provide the complete requested metadata.
In particular, do not use --proto:default_values=false: it can omit an
explicitly supplied value equal to its default. Keep unflattened selectors to
retain scalar and dictionary alternatives. Omitted repeated value fields mean
empty collections; an ordinary LABEL without stringValue represents None.
Malformed or unsupported relevant encodings and conflicting records fail
before output replacement. The parser accepts native emitted JSON, not explicit
JSON null substitutes for omitted protobuf fields.
The capture macro sets these options automatically when build_deps_only is
true. With the default false it preserves its original query options, including
implicit inputs and omitted attributes. JSON-input rules cannot repair an old
capture; their caller supplies the required metadata and upstream filtering.
Mindmap overview
Select diagram_type = "mindmap" in either rule, or --diagram-type=mindmap
on the command. Flowchart remains the default. Both views select the same
targets using the existing depth, file, and external options.
The mindmap is a build-input inventory: branches describe ownership and
list each selected target once. They do not represent dependency edges.
Use the flowchart to trace build relationships, shared inputs, or cycles.
With package grouping enabled, local packages and external repositories form
separate branches; external packages are nested under their repository within
External. Without grouping, target captions retain their full labels and
external targets still share the External branch. Rule kinds remain visible.
Mindmap uses the renderer’s pinned tidy-tree layout. Flow direction applies only
to flowcharts. Large canvases are acceptable; prioritize readable captions and
clear ownership when selecting a view.
bazel_deps_mermaid(
name = "input_inventory",
target = ":application",
diagram_type = "mindmap",
external_leaves = True,
group_by_package = True,
include_files = True,
)
Graph semantics
In flowcharts, arrows point from a target to its dependencies. Ungrouped nodes
show full target labels; grouped nodes show short names beneath full package
captions. Both views retain rule kinds. Generated files depend on their generating rule. Labels use
generated identifiers and escaped text so target names cannot become Mermaid
syntax or HTML.
The target macro includes explicit and implicit build inputs while excluding
execution tools and non-dependency attributes such as visibility. This is Bazel’s
unconfigured target graph: select() can include multiple possible branches.
It does not represent one platform’s configured targets or action graph.
Depth measures actual graph edges before display filters. Filtering removes
nodes and their incident edges without inventing replacement edges, so a node
reached through a hidden file or external target can appear disconnected.
The explicitly requested root always remains visible. References to records
outside the input capture are omitted, including at a bounded query frontier.
With external_leaves, traversal and all outgoing edges stop at external
targets. A descendant can still appear when reached through a separate local
path. The depth and file filters continue to apply; use include_files to
display dependencies that are source or generated files.
Generated example
This view is built from the converter command itself at depth two:


The site package exposes companion targets that analyze :site at depth eight:
bazel build //projects/alwaldend.com:deps_mermaid \
//projects/alwaldend.com:deps_svg //projects/alwaldend.com:deps_webp \
//projects/alwaldend.com:deps_dark_webp
Outputs are dependencies.mmd, light/dark dependencies.svg siblings,
light dependencies.webp, and dark dependencies.dark.webp under
bazel-bin/projects/alwaldend.com/. This overview reaches site content packages
and repository documentation owners while omitting files, external targets,
tool dependencies, and visibility metadata. It is not a complete transitive
graph. The images use the site’s shared palette and renderer.
These outputs stay outside :site’s own
inputs, since embedding a graph into the target it queries creates a dependency
cycle. The separately generated converter example above is packaged into the
site’s documentation.
The companion :deps_mindmap_source, :deps_mindmap_svg, and
:deps_mindmap_dark_webp targets reuse that depth-eight JSON capture and target
selection for a package ownership inventory. They produce
dependencies.mindmap.mmd, light/dark SVG siblings, and
dependencies.mindmap.dark.webp. As with the flowchart, these are build
artifacts outside the site’s own input closure.
genquery loads the complete scope closure before evaluating a depth limit.
Every package in that closure must therefore load successfully, including
platform branches absent from the rendered diagram. If a foreign-platform
dependency cannot load on the host, use a bounded command-line query and the
JSON-input rule or command to inspect the available portion of the graph.
Validation
bazel test //projects/bazel_deps_analyzer/test/e2e:e2e_test
The E2E command checks graph semantics and failure handling, then verifies a
real Bazel diamond graph rendered through Mermaid. It preserves the diagram,
WebP, and JSON report in its undeclared test outputs.
10 - Bazel Gazelle transitive visibility
Generate package dependency restrictions from TOML path mappings
This standalone Gazelle extension maintains package(transitive_visibility = ...) from a TOML mapping of workspace-relative directories to package groups.
The default configuration is tools/transitive_visibility/transitive_visibility.toml.
[paths]
"." = "//:transitive_consumers"
"infra" = "//infra:transitive_consumers"
"tools" = "//tools:transitive_consumers"
"tools/nogo" = "//tools:build_api_consumers"
Mappings include descendant directories. The longest directory-prefix match
wins; infra does not match infrastructure. Paths are canonical relative
directories, with "." denoting the workspace root; globs and parent paths are
not accepted. Labels must be absolute. Package groups remain in their owning
BUILD files and define the permitted consumers.
Use -transitive_visibility_config=path/to/policy.toml to select another file.
Relative filenames resolve from Gazelle’s repository root. A missing default
configuration leaves policy unmanaged; an explicitly selected missing file is
an error. Malformed TOML, unknown fields, empty mappings, invalid paths and
invalid labels fail before BUILD output is written. Obsolete
gazelle:transitive_visibility comments are rejected with a migration message.
Only the transitive_visibility attribute is managed. Other attributes and
comments are preserved, and managed package() calls in existing files appear after loads and
before rules. Unmatched packages retain their manual declarations. The plugin
does not create BUILD files in otherwise empty directories. Register it after
other generators so it covers the packages they create. Gazelle’s normal
ignored-directory and nested-workspace boundaries apply; parent configurations
are never searched.
Register @bazel_gazelle_enforce_transitive_visibility//pkg/gazelle in the
languages of a gazelle_binary. //cmd/gazelle provides the plugin-only
executable. This module’s own configuration is transitive_visibility.toml:
bazel run //cmd/gazelle -- -transitive_visibility_config=transitive_visibility.toml
Bazel enforcement is separate from generation. Enable
--experimental_enforce_transitive_visibility=true and use Bazel 9.3.1 or
later. Bazel checks target dependencies for the entire package; it cannot
distinguish target roles inside that package and does not govern Starlark
load() statements.
Enforcement limitation in Bazel 9.3.1
Direct target and source-file restrictions work. An integration experiment
also found that an intermediary with its own permissive transitive_visibility
declaration can lose an inherited restriction: a forbidden consumer of its
filegroup succeeds. Removing the intermediary’s declaration makes the same
indirect dependency fail. Consequently, generated declarations are not a
guarantee of complete indirect dependency enforcement in this Bazel release.
The extension emits the requested policy; it does not repair Bazel’s analysis.
The native check is also broader than an artifact-only dependency policy.
Its 9.3.1 validator
does not exempt execution-tool attributes; declaring a dependency with
cfg = "exec" does not itself exempt it. Package groups cannot express
“allow this executable as a build tool, but forbid it as a runtime input.”
Explicit build-support package exceptions are therefore an approximation.
Starlark load() edges are separate. Use --notool_deps when querying the
ordinary dependency graph; that query option does not change build enforcement.
From the monorepo root, run
bazel test //projects/bazel_gazelle_enforce_transitive_visibility/... to exercise the real
Gazelle command. The tests preserve generated BUILD files and a summary under
Bazel’s undeclared test outputs.
Gazelle 0.54.0 appends package() after generated rules when it creates a new
BUILD file. A subsequent run moves it after the loads; further runs are stable.
The repository uses unmodified upstream Gazelle and does not patch this behavior.
11 - Bend rules
Bazel rules for running and checking Bend 2 programs
rules_bend integrates the Bend 2 compiler
into Bazel. It requires Bazel 9.3.1 or later. Bazel selects the Bend executable
from a registered toolchain. Source checks select it for the execution
platform and runnable programs select it for the target platform. The module
registers Bend 2.0.40 and its standard library by default for Linux x86-64.
Run the compiler itself with bazel run //projects/rules_bend:bend -- version
or bazel run @rules_bend//:bend -- version in a standalone consumer.
Load the rules from @rules_bend//:defs.bzl in a standalone consumer or from
//projects/rules_bend:defs.bzl in this repository.
load("@rules_bend//:defs.bzl", "bend_binary", "bend_check")
bend_binary(
name = "hello",
main = "hello.bend",
)
bend_check(
name = "check_hello",
main = "hello.bend",
)
For example, hello.bend can contain:
import Base
def main() -> IO(Unit):
IO.print("Hello from Bend")
Run the program with bazel run //:hello. Pass program arguments after
--, as in bazel run //:hello -- "one argument". The launcher forwards
standard input, output, errors, and Bend’s exit status.
Check the program with bazel build //:check_hello. The sandboxed action
invokes Bend with --check-only and emits check_hello.checked on success.
List local imports in srcs, including transitive imports. Filegroups can share
source sets between targets. The rules stage files at their workspace-relative
paths for import resolution. Include LAWS.bend when it participates in a
proof check. The check action runs offline.
Register a custom Bend distribution
In a package that exposes the Bend executable and its standard library as a
Bazel executable target, declare the toolchain registrations.
load("@rules_bend//:defs.bzl", "bend_toolchain")
bend_toolchain(
name = "custom_bend",
compiler = ":bend",
compatible_with = ["@platforms//os:linux", "@platforms//cpu:x86_64"],
)
Register both targets in the consuming MODULE.bazel:
register_toolchains("//tools/bend:custom_bend_exec", "//tools/bend:custom_bend_runtime")
Validate the project specification
From the repository root, run
bazel test //projects/rules_bend/openspec:validate_test.
12 - Ci platform
Abandoned CI platform with a Go backend and Vue frontend
An abandoned continuous integration platform with a Go backend and a Vue
single-page frontend. The source retains its job, pipeline, and project
management components.
Links
Features
- Clean architecture
- Backend: Golang, Gorm, Fiber, Hcl, Postgresql
- Frontend: SPA, VueJS with PrimeVue
Arch

Layout
ci_platform/
├── cmd/ci_platform/ CLI entry point
├── internal/
│ ├── api/ HTTP controllers, middleware, and presenters
│ ├── command/ CLI dispatch
│ ├── docs/ Embedded OpenAPI documents
│ ├── entity/ Enterprise business rules
│ ├── frontend/ Retained Vue frontend source
│ ├── infrastructure/ Framework and driver implementations
│ ├── pkg/ Backend support packages
│ ├── usecase/ Application business rules
│ └── web/ Frontend filesystem adapter
└── openspec/ Source contract and maintained changes
Resources
architecture
golang
security
frontend
13 - ComfyUI tools
Reusable ComfyUI custom nodes and image-generation workflows
This project owns reusable ComfyUI nodes, workflows and evaluation tooling. Each node has its
own directory under nodes/, with its implementation, test and
README. Workflow definitions are grouped by model under workflows/. Their model catalog defines model profiles and download metadata shared with deployment. Evaluation code and reusable cases live here; run configuration and deployment,
model downloads, credentials and rental state belong to
image-generation infrastructure. The
repository CLI and local launchers remain in
tools/comfyui.
Workflows
The workflow files, including the Flux panel sequence, contain single-reference, character/style and
prompt-sequence graphs for FLUX.2 klein Base and Qwen-Image-Edit, plus
Juggernaut XL v9, NoobAI XL 1.1, Illustrious XL v2.0-STABLE, HiDream-I1 Full,
full Chroma, MOSS-Image and archived Chroma Flash examples. All files use <profile>-<purpose>.json; the saved
workflow name uses that same basename. Load a matching JSON in ComfyUI or pass it to the
authenticated infrastructure CLI. Each graph requires its matching models and
nodes; the rental’s model profile
selects which files to install. Keeping a workflow here does not install its
dependencies or establish runtime acceptance.
The Juggernaut txt2img,
img2img and
prompt sequence use
the native SDXL checkpoint loader with the encoder and VAE bundled in the
checkpoint. Start with 1024-square output, 30 DPM++ 2M SDE/Karras steps and CFG
6.5. Img2img starts at denoise 0.65 and preserves some reference composition;
it does not extract only its style. Use style reference for
a new scene guided by a reference image, or
style prompt sequence
for several panels sharing that style. Both use the previously approved
RES4LYF pack, its SDXL patcher and a VAE-encoded style guide while sampling
from fresh noise. The guide’s weight starts at 1; zero disables it for a
fixed-seed comparison. Describe the broad medium and new scene in the prompt.
These graphs start at 30 RES 2M/beta57 steps and CFG 6.5. They guide style;
they do not guarantee exact style isolation or character preservation.
Offline graph checks do not establish GPU execution or style quality.
For several references that contain both characters and style, use
juggernaut-multi-reference, or juggernaut-multi-reference-prompt-sequence
for a sequence. Select three reference files; reuse a file if you have fewer.
Each reference is resized and center-cropped to 512 square, then all three feed
the approved SDXL Plus IP-Adapter with concatenated reference embeddings. The
standard SDXL sampler starts from fresh noise. The adapter’s weight starts at
0.8; raise it for more reference influence or lower it for more prompt freedom.
For more scene adherence, try weight 0.5 and end_at 0.8; this retained the
neutral references’ geometric style while adding the requested reading scene
in the live comparison. Keep linear for general subject/style conditioning. Describe the wanted scene,
characters and medium in text as well. These workflows guide appearance and style;
they do not guarantee exact identities or isolate every character in a crowded
reference. The sequence uses the same references for each panel.
The adapter uses the approved
ComfyUI_IPAdapter_plus revision
and publisher-pinned SDXL Plus and CLIP-ViT-H weights. Upstream is in
maintenance-only mode; future runtime upgrades need compatibility validation.
The older RES4LYF style graphs retain the upstream float64 style-patcher
default to avoid mixing float32 reference features with its float64 SDXL branch.
noobai and illustrious provide the same seven SDXL workflow purposes
as Juggernaut. NoobAI also provides
noobai-image-to-image-prompt-sequence: enter one prompt per nonempty line in
Prompt Sequence; every image starts from the same original reference. It saves
separate PNGs with shared negative text, a panel counter and unique grouped
filenames. Adjust output dimensions in ImageScale and denoise in KSampler
(default 0.65). They reuse the shared SDXL builder, style patcher and approved
IP-Adapter/CLIP vision weights. Native graphs start at 30 Euler ancestral/normal
steps and CFG 5.5; NoobAI uses neutral tag-style starting prompts. These are
starting presets, with no new GPU acceptance or reference-quality claim.
hidream-i1-full provides text-to-image, img2img, style-reference, all three panel
sequences and ordinary/masked chained img2img GIFs. The img2img sequence reuses
the same original reference for each prompt, with editable output dimensions
and denoise. Native graphs use 50 UniPC/simple steps,
CFG 5 and shift 3, following the official full-model example. They load four
local text encoders: CLIP-L, CLIP-G, T5 and Llama 3.1 8B. Style graphs reuse
RES4LYF with its dedicated HiDream patcher and style sampler. This is style
guidance; it is not a trained character-reference adapter. Its GIF workflow
completed the approved plush case on a verified datacenter CMP 170HX 40 GiB
on 2026-11-11. The output drifts in appearance and does not establish convincing
petting motion. Other HiDream workflows still have offline packaging checks
only; their GPU execution and output quality remain unverified.
uso provides native subject-only, style-only and combined subject/two-style
reference workflows, each with a prompt-sequence variant. umo-uno provides
single and three-identity reference workflows and their sequences, without
USO’s style-projector branch. They share the native FLUX.1 graph builder,
load matching model adapters and preserve the publisher’s reference positioning.
All sequences reuse the same original reference inputs per prompt and keep
progress plus uniquely grouped filenames. Both families expose output size
and native sampling controls. At CFG 1 their sequence negative output is
unused. See the model options
for workflow names, reference roles and starting settings. Source and offline
packaging are available; GPU compatibility and reference quality are untested.
All seven Juggernaut workflows completed on the replacement rental on
2026-11-10, producing 13 neutral 1024-square images at 30 steps. Both style paths
completed without the reported dtype error. This establishes execution for the
selected runtime; reference fidelity and scene adherence still depend on inputs
and guidance settings. The original WCT paths produced softer images in this
check than the adapter path. Deployment evidence belongs to the
owning infrastructure record.
For FLUX.2 dev 32B, use flux2-dev-text-to-image without a reference,
flux2-dev-single-reference with one image, or flux2-dev-multi-reference
with three images. Both reference paths have a matching -prompt-sequence
variant. Reference images supply character and style through native VAE latents. Start at
1024 square, 28 Euler steps and FluxGuidance 4. This model uses distilled
positive guidance and has no negative branch; the sequence node’s negative
output is unconnected in this family. Its Mistral text encoder runs locally.
The chroma-hd profile provides text-to-image, image-to-image,
style-reference, prompt-sequence and style-prompt-sequence workflows with the
full Chroma1-HD checkpoint, FP16 T5 and original VAE, plus a chained img2img GIF
workflow with one prompt per frame. Native sampling starts at
40 Euler/beta steps and CFG 3; style sampling uses the already approved
RES4LYF Chroma patcher and 40 RES 2M/beta57 steps with CFG 3. Its style guide
starts at weight 0.5 and ends at step 15, which preserved more detail than
weight 1 through all steps in the controlled neutral comparison. The two sequences
use the existing multiline node and shared negative prompt. Img2img preserves
composition; the style path guides style from fresh noise and does not promise
character identity. The original three chroma-* workflows retain their Flash
defaults as archived examples.
The full Chroma GPU acceptance
verifies execution and ordered outputs, with significant visual limits: img2img
can preserve the source too strongly, the style guide can blur detail, and comic
wording can elicit extra panels and lettering. Start with native text-to-image;
reference and sequence paths require prompt/strength tuning for useful results.
Text-to-image Apps
Build the workflow catalog with bazel build //projects/comfyui_tools/workflows:workflows.
Under bazel-bin/projects/comfyui_tools/workflows/, open the model directory
and import its *-text-to-image.app.json file into ComfyUI. The catalog includes
Apps for Juggernaut XL, NoobAI XL, Illustrious XL, HiDream-I1 Full, Chroma HD,
Chroma Flash, FLUX.2 dev, and MOSS-Image SFT, Base and Heal.
Enter a prompt, adjust the canvas size and sampling controls, and run the App
to see saved images. Models that use negative conditioning expose a negative
prompt. The FLUX.2 dev App uses distilled guidance and expects dimensions in
multiples of 16. Install the matching model files before running the App.
Danbooru tag search
Use the standalone Danbooru Tag Search App
to look up prompt tags. The optional installation bundle includes the search
node and the repository-pinned vocabulary.
MOSS-Image examples
The moss-image family supplies native examples and prompt-sequence variants, adapted from the
official templates
as compact native graphs without the optional LLM prompt enhancer. Their model
files come from the infrastructure profile; generation uses local Qwen3.5 text
encoding and the small FLUX.2 VAE.
moss-image-text-to-image and moss-image-base-text-to-image use SFT and Base,
respectively, with 1024-square output, 25 ER-SDE/simple steps, CFG 2.5 and
layer-22 skip guidance through the first half of sampling.moss-image-base-text-to-image-euler-50 uses the Base checkpoint with
50 Euler/simple steps and CFG 3.moss-image-layout-guided and moss-image-base-layout-guided add an editable
native bounding-box canvas. Edit the box description and overall caption;
canvas size drives the prompt coordinates and output latent dimensions.moss-image-image-edit requires reference.png selected in Load Image. Edit
its instruction; the example uses the SFT edit LoRA, Moss-Image-Edit reference
conditioning on both branches, 30 Euler/normal steps and CFG 4. The reference
is scaled to about one megapixel and determines the output dimensions.moss-image-image-edit-two-references takes Image 1 as the base and Image 2
as the donor. Select both files and identify the replacement in the prompt.
The base image determines the output dimensions.moss-image-color-depth-control requires prepared color-map.png and
depth-map.png selected in their Load Image nodes. Start with both maps at
1024 square. Region colors are identifiers; depth is white near the viewer.
Disconnect an optional map input to use only the other map. Change the latent
dimensions when using another size. The example uses the control LoRA,
layer-24 skip guidance, shift 5, temporal score rescaling, 25 ER-SDE/simple
steps, CFG 3 and control ending at 60% of sampling. It does not estimate depth.
The sequence variants use the existing multiline Prompt Sequence node:
moss-image-prompt-sequence and moss-image-base-prompt-sequencemoss-image-layout-prompt-sequence and moss-image-base-layout-prompt-sequencemoss-image-image-edit-prompt-sequencemoss-image-color-depth-prompt-sequence
Enter one panel prompt per nonempty line, shared context and shared negative
text in Prompt Sequence. One Run saves ordered PNGs with a fresh grouped filename
prefix and displays panel progress. Layout variants reuse the same box captions
and positions; edit variants reuse the original reference for every instruction;
control variants reuse the selected maps. Panels are independent generations,
with no joint attention or guaranteed character continuity. Sampling defaults
and reference requirements match the corresponding single-image examples.
The image-generation Ansible stage installs all twelve selected examples.
You can also save a generated workflow through the authenticated API, for example:
bazel build //projects/comfyui_tools/workflows:workflows
bazel run //infra/image_gen:comfy -- workflow save \
"$PWD/bazel-bin/projects/comfyui_tools/workflows/moss-image/moss-image-prompt-sequence.json" \
--name moss-image-prompt-sequence --where local
Repeat the save command for the other five sequence variants. This stages user
workflows without replacing the running rental or changing its startup command.
These are editable examples, not guarantees of exact edits, layout or reference
fidelity. Actual GPU execution and its limitations belong to the
deployment record.
MOSS-Image-heal
The moss-image-heal family uses the Heal INT8 ConvRot checkpoint,
the existing MOSS text encoder and the small FLUX.2 VAE. Start with 1024-square
images, 25 ER-SDE/simple steps and CFG 2.5.
moss-image-heal-text-to-image generates one image from a prompt.moss-image-heal-layout-guided uses the editable bounding-box canvas in Graph Mode.moss-image-heal-prompt-sequence generates independent panels from one prompt
per nonempty line with optional shared context and negative text.
The text-to-image and prompt-sequence graphs also have .app.json variants
with prompt, size and sampling controls and a gallery for saved images.
The sequence requires the first-party Prompt Sequence node.
The image-generation Ansible profile
installs the models, node and all five files.
MiniMax H3 Video
- Text to video
starts from an editable example prompt.
- First and last frame
takes two uploaded images. Select one in each labeled image loader and edit
the prompt to describe the transition. Match the images’ aspect ratio to the
configured canvas.
Both workflows start at 864×480 with 107 frames at 24 fps and save an MP4
with stereo audio. The deployment profile installs the four preselected model
files and both workflows. The generated graphs use native ComfyUI nodes.
Workflow source and generation
The maintained sources are workflows.jsonnet,
model-specific workflows.libsonnet files and shared graph/node libraries in
workflows/internal/. The sequence transformation is shared across model families.
Connections are declared once; generation derives port metadata and reciprocal
link lists. SDXL model families share one graph builder. The public rental
configuration owns an asset registry keyed by filename; profiles reference
those assets and approved node packs by name. Workflows select the first
download of each required kind, with explicit component roles for HiDream’s
four text encoders. Additional downloads remain available without
changing those selections. Recorded workflow defaults remain available when
downloads are disabled.
bazel build //projects/comfyui_tools/workflows:workflows
bazel test //projects/comfyui_tools/workflows:format_test
Native JSON is generated beneath
bazel-bin/projects/comfyui_tools/workflows/<profile>/ at the documented names.
Edit Libsonnet source rather than generated JSON. Terraform and documentation
consume those declared outputs directly. The pinned Jsonnet compiler and
formatter are build tools and are never installed on the rental. To format an
edited source, pass its absolute path to
bazel run //tools/jsonnet:format -- --in-place /absolute/path/to/source.libsonnet.
NoobAI sketch-guided edits
Import noobai/noobai-sketch-edit.app.json for a whole-image edit, or
noobai/noobai-sketch-edit-masked.app.json to restrict the edit with a painted
mask. Matching .json files open in Graph Mode. Both reuse NoobAI XL 1.1 and
the profile’s existing Canny ControlNet; no additional weights or node pack is
needed. These are still-image editors, separate from the sequence Apps.
Choose the original picture in Source image and an aligned outline drawing
in Separate sketch. The source supplies starting pixels; only the sketch
supplies structural edges. Draw the desired final outline, removing obsolete
lines. Arrows, crossed-out parts and written annotations are not edit commands.
Keep both inputs on the same framing and aspect ratio. The output canvas starts
at 1024 square; change its width and height to multiples of eight matching the
source aspect ratio. Source and sketch are resized to that canvas without cropping.
Describe the complete finished image in NoobAI tags, including appearance,
setting and the desired pose. Denoise starts at 0.65: raise it for larger
changes or lower it to retain more source composition. Strength starts at
0.7 and controls sketch influence; end_percent starts at 0.8. Set strength
to zero with the same seed for an unguided comparison. The two Canny thresholds
start at 0.1/0.3; lower them if faint sketch lines are missing. Clear outlines
are the intended input; rough scribbles are not a dedicated scribble-control path.
For the masked variant, open the source loader in Graph Mode, use its native
Mask Editor, paint the allowed edit area and save the edited input before
running. White permits edits; black preserves the source. Cover both the old
shape and the space the new shape will occupy. An empty mask returns the resized
source unchanged. The same resized mask controls sampling and final compositing,
preserving source pixels wherever it is zero. The unmasked App edits the whole
canvas. Each run saves one PNG with native generation metadata.
Offline graph and deployment checks do not establish sketch fidelity, anatomical
correctness or precise pose edits. GPU inference for these new graphs has not
been performed. Profile selection stages the files through the normal Ansible
deployment; importing an App does not install its model weights.
NoobAI image sequence App
Import the generated noobai/noobai-image-sequence.app.json from the workflow build
into ComfyUI. It opens in native App mode with a reference uploader, shared
appearance/style text, an action editor and a results gallery. Use Graph Mode
to inspect its editable graph. The App targets frontend 1.57.6, bundled with the
configured ComfyUI v0.44.0. Its .app.json filename also identifies it in ComfyUI’s
Apps list. NoobAI workflows are saved through the authenticated workflow API after
boot, keeping its startup within the provider limit. The complete catalog remains
generated and importable; model and node installation still uses normal provisioning.
The matching noobai-image-sequence.json opens the same graph in Graph
Mode. It requires the NoobAI checkpoint, approved SDXL Plus
adapter/CLIP vision weights and the first-party image_sequence module; an imported
JSON alone does not install those dependencies. Build with:
bazel build //projects/comfyui_tools/workflows:workflows
Select the main appearance reference and optionally two additional views; keep
unused inputs at (none). These references remain active for the whole sequence.
Use the shared prompt for stable appearance and style. Enter complete desired-image
tags, one image per nonempty line:
standing, snowy park, beside a bench
sitting, snowy park, on a bench
---
standing, library, beside a bookshelf
reading, library, holding an open book
The first image in each scene starts from fresh noise. The following images edit
the preceding decoded result at change strength, initially 0.6. Raise it
for larger changes, lower it to retain more composition, and insert --- for a
new location or camera setup. No page layout, speech bubbles or comic style is
added automatically. Describe the wanted medium in the shared prompt.
Reference weight starts at 0.05; stronger generic SDXL conditioning can
distort NoobAI instead of preserving identity.
Choose dimensions once for the whole sequence. Keep the seed fixed while tuning.
Set image count to 1 for a single preview, or 0 for all remaining actions.
For continuation, keep the complete action list, select the accepted preceding
image in continuation, and set start image to the next action number.
Starting inside a scene requires that image. Starting at a scene boundary creates
a fresh composition. Completed PNGs are saved immediately with grouped ordered
filenames and effective prompt/seed metadata; the App gallery populates on completion.
The default action list demonstrates two scenes with three images each: a robot
raises its hand in a snowy park, then opens a book in a library. Camera, location
and lighting tags repeat within each scene; --- changes the scene. Keep shared
appearance tags in the shared prompt and describe the complete desired image on
each action line.
The selected run produces one combined GIF and no per-scene GIF files.
GIF frame duration defaults to 500 milliseconds per
keyframe. Interpolation multiplier defaults to 4x using the repository-pinned
RIFE engine; 1 disables interpolation. Each scene is smoothed separately and the
combined GIF retains hard scene cuts. Original PNGs remain available after
interruption; no partial GIF is published. Partial runs include only new images.
Control strength defaults to 0.2 in the App and guides same-scene edits from the preceding
image’s Canny edges. Zero disables it. Control end defaults to 0.75. Lower the
strength for larger pose changes; edges can resist those changes. New scenes
start without the old scene’s guide.
The App starts IP-Adapter reference influence at 0.05 for NoobAI. The generic
SDXL adapter can overwhelm this checkpoint at stronger weights. Shared appearance
tags and previous-image continuation provide additional continuity; exact identity
across fresh scenes and precise pose edits are not guaranteed.
After an authorized NoobAI deployment, use the infrastructure owner’s
in-place update to install the node,
approved Canny checkpoint, App and RIFE engine. NoobAI defers this node’s source
and workflow documents to that stage to keep startup below its payload limit.
The App can also be refreshed through the authenticated workflow API:
bazel run //infra/image_gen:comfy -- workflow save \
"$PWD/bazel-bin/projects/comfyui_tools/workflows/noobai/noobai-image-sequence.app.json" \
--name noobai-image-sequence.app --where local
The node contract describes partial runs,
interruption and drift limits. Offline checks verify transitions and saved media.
The live acceptance
records the completed two-scene GPU run and its remaining pose/identity limits.
Reference and scene-composer versions
Two separate native Apps make the different generation strategies explicit:
| App | Reused information | Generation |
|---|
noobai-reference-sequence.app.json | Uploaded references, shared appearance text and preceding pixels within a scene | Fresh scene starts, then previous-image edits; incrementing action seeds |
noobai-scene-composer.app.json | Fixed character/clothing/style text, per-scene setting and optional installed LoRA | Independent images with a fixed seed and a second latent refinement pass |
Both have matching editable .json graphs and six-image, two-scene examples.
Both save PNGs and one combined GIF. Their new presets start with interpolation
disabled; the reference preset also starts Canny at zero to avoid locking the
previous pose. Existing noobai-image-sequence files remain import-compatible.
The composer adapts the shared-prompt organization and two-pass sampler in the
operator-supplied Tache Scenes Composer, without its external prompt/utility
node packs or preset library. Enter a fixed character description, clothing and
render style. Enter one setting per scene on separate lines, or one setting for
all scenes. Enter one desired-image action per line, using --- between scenes.
Settings are expanded into the effective prompts before sampling. The default
uses an adult woman in a red coat in a snowy park, then a library.
The optional LoRA selector lists only locally installed weights and defaults to
(none). It installs nothing. The second pass uses the same model, prompt and
seed to resample each first-pass latent at lower denoise; it does not transfer
information between images. Set refinement steps to zero to disable it. Shared
tags and a fixed seed are not an identity lock, and refinement can worsen an image.
This version does not use uploaded reference images. Inspect individual PNGs
before enabling interpolation; smoothing cannot correct missing actions.
Prompt sequences
The Prompt Sequence node uses ComfyUI’s native
multiline text box. Select line and enter one prompt per line; blank and
whitespace-only lines are ignored, so they can separate prompts visually.
Select blank line only when each panel description spans several lines.
The sequence node also contains a shared negative_prompt text box. In the
Juggernaut, Flux Base and Qwen sequence workflows, its value
applies to every panel and is not split into lines or combined with positive
context. The generated sequence graphs connect it to the model’s native negative
encoder, replacing the separate editable negative-prompt box. Juggernaut retains
its existing negative default; Flux and Qwen start empty. The encoder remains
in the graph to provide conditioning to the sampler.
Earlier saved nodes retain their first four input positions and
their prompt/filename output slots; an omitted negative prompt defaults to empty.
For Flux/Qwen, shared context describes image 1
as the character and image 2 as style. Juggernaut’s native sequence uses shared textual character and style descriptions;
its style-sequence variant also reuses one reference image for style. Run a prompt-sequence workflow once for
sequential panels named comic_<run UUID>_001, comic_<run UUID>_002, and so on.
Each run has a unique prefix, including repeated runs with identical text. The
sequence remains one native job so its media outputs remain grouped. The native
sampler displays Panel 2 of 3 alongside its step progress; current workflows
connect the sequence node’s optional MODEL path to enable that counter. Sampling batch size
remains one; native list mapping reuses the shared conditioning. Panels do not inherit
previous-panel composition or story state. The node requires no external package.
The JSON separator remains available for lists saved by the former custom editor.
Use chroma-hd-image-to-image-gif to animate from an initial image, with one
prompt per generated frame in the same multiline box. Each decoded image is VAE-encoded for the
next img2img step. The result is one looping GIF and a native frame batch; start
at denoise 0.45 and 6 fps. This makes discrete chained images without motion
interpolation. The GIF node documents
timing and output behavior.
For controlled frame edits, choose frame_source=original and
frame_seed_mode=fixed; each pose then starts from the same reference and
noise. Chroma, HiDream and Qwen each have an image-to-image-gif-masked variant
with an adjustable soft edit rectangle. Qwen’s GIF paths re-encode the preceding decoded image in the native
instruction-based edit encoder when frame_source=previous; original mode
keeps the initial reference for independent edits. Identical first/last pose
prompts provide a controlled loop boundary with original-reference/fixed-noise
sampling. These workflows still require visual motion evaluation.
For Qwen animation, start with qwen-keyframe-edit or
qwen-keyframe-sequence. Both edit a crop independently from the shared original,
then feather the edited crop onto the original scene. The crop’s X/Y controls
also position the composite; include the old and desired hand positions inside
the crop. The separate movement rectangle controls which part of that crop is
blended back; include both old and intended hand positions inside it, away from
its feathered boundary. Qwen receives only the crop as its image reference.
The crop is sampled without a latent noise mask. The raw crop and final PNG
are both saved for inspection. Original scene pixels outside the movement area
are retained before image encoding, but the workflow cannot guarantee a correct
pose or alignment inside it. Reject edits that cross or misalign with the mask.
The initial crop/full-scene-reference trial produced redraw and seams. A later
single-reference localized press with a narrower composite was steadier;
a precise hand lift remained unreliable. These are inspectable still-edit tools,
not a validated natural-petting animation preset.
For rough-pose repair, use qwen-pose-guide-edit: image 1 is a roughly composed
target frame and image 2 is the original appearance reference. Supply equally
sized, aligned images with only one hand in the guide. The prompt assigns pose
to image 1 and appearance to image 2. The guide is scaled to about one megapixel
with its aspect preserved and dimensions rounded to eight-pixel steps. Sampling
starts at denoise 0.7 to retain visible guide geometry. The guide determines the
sampling canvas;
the output is restored to the original dimensions, and a feathered region is
composited onto the original. Shared X/Y and width/height controls keep the crop,
composite and mask matched; the region must include old and target
poses plus the exposed background. Inspect both the full repair and composite.
This supplies visible geometry but does not enforce the pose or temporal
consistency. Evaluate a single repaired pose before producing a sequence.
The four-edit rough-pose trial preserved a lifted hand and improved its anatomy
at denoise 0.7, but retained rough background placeholders. Full-denoise repair
returned to the original contact pose; reversing the reference order produced a
waving gesture. A separate background-only masked repair removed most gray fill
while preserving all pixels outside its mask, but left a cutout artifact and
changed the plush top. No finished frame or GIF passed visual acceptance. Avoid
large flat placeholders in guides; repairing anatomy and rebuilding vacated
background may require separate, independently inspected edits.
A later photographic-guide trial
uses image-editor-prepared background/hand layers and FFmpeg to construct target
poses, then refines every selected pose with Qwen and interpolates with RIFE.
Increasing the guide’s hand travel from 14 to 154 pixels makes the movement
visible. Five inspected Qwen poses produce a 64-frame loop, but the forearm still
deforms unnaturally and textures vary. Lowering denoise from 0.7 to 0.45 removes
an extra digit in one pose but does not repair another pose’s artificial skin
texture. These are case-specific findings, not new defaults or a validated
natural-animation preset. Guide preparation is a separate image-editing step;
the complete process is not solely Qwen and RIFE.
For structural references, first use qwen-sketch-reconstruction with a coherent
target sketch as image 1. It produces a raw full-frame reconstruction from that
single reference. Then use qwen-structure-guide-edit: image 1 remains the sketch
and image 2 adds the original appearance photograph. Both graphs share the
prompt, blank negative text, seed 42, 40 steps, CFG 4 and full denoise. Both
retain normal native semantic and VAE reference conditioning on both branches.
The sketch determines the sampling canvas. Compare raw outputs to distinguish
sketch comprehension from competition with the appearance reference.
The structural-reference workflow also restores the original dimensions and
saves an optional feathered composite onto the original. Inspect its raw output
first. Earlier exports used the opposite reference order; import the corrected
graph and assign the inputs using their titles. Native conditioning has no
separate ControlNet strength and does not guarantee pose or identity preservation.
Use the prepared sketch and comparison procedure.
The earlier structural-reference trial followed the moved-hand outline closely, but
raised the plush into the palm instead of preserving a gap. Full-scene edges
introduced a dark smear; geometry-only conditioning lost the pose, and a white
sketch produced a doubled hand. None of the four outputs passed finished-frame
acceptance. This remains an experimental guide workflow; no usable petting GIF
was obtained. Subsequent input review found conflicting head contours in the
scene sketch. In the corrected-guide GPU trial,
the sketch-only default reconstructs a clear hand gap and a coherent scene.
Adding the original photo restores its appearance but introduces unwanted crown
folds. These results demonstrate useful guidance, not a finished petting animation.
Inspect each pose before loading selected, equally sized PNGs into
qwen-keyframe-gif. This model-free workflow combines three approved poses,
optionally reverses them back to the first pose, and uses the existing RIFE
engine at 1x (disabled), 2x, 4x or 8x. Reversal closes the loop; interpolation
smooths accepted poses and cannot repair malformed hands. The assembly node
also accepts any native IMAGE batch of 2 to 128 keyframes. Each input is retained
as a PNG. The older chained Qwen GIF workflows remain available for comparison.
The image-generation Ansible deployment packages the selected node sources and
workflow files through Bazel and installs them with the shared comfyui_tools role. This project
does not own the upstream ComfyUI CLI, server image or infrastructure state.
Offline validation
bazel test //projects/comfyui_tools/nodes/prompt_sequence:prompt_sequence_test
bazel test //infra/image_gen/tf_setup:tf_tests.test_test
These checks exercise node behavior and Terraform’s packaged workflow inputs.
The node uses the standard ComfyUI editor without a custom browser extension.
They do not access
a rental or establish compatibility with its frontend version or GPU image quality.
Continuous experiments
The experiment runner maintains a configurable owned job
buffer on an existing endpoint. External producers supply arbitrary native
workflows and meaningful variations. It preserves original media, workflow
snapshots, hashes and a resumable private journal, with no instance lifecycle
operations. The ComfyUI experiments skill
covers queue observation, feedback and result review.
Evaluations
The evaluator runs independent, bounded rental workloads using the existing
Vast SDK and ComfyUI CLI. Reusable cases include the supplied
thorn-landscape artwork prompt/reference and the plush-petting GIF reference.
Infrastructure composition owns the
run matrix, credentials, limits and final/manual cleanup targets. No personal
Terraform state is read or changed. All executable code stays in this project.
Matrix groups expand hardware/model/workflow/case coordinates. All compatible
workflows, cases and seeds sharing a hardware/model profile reuse one rental.
Each rental starts as soon as its own endpoint is ready, keeps native jobs queued
ahead of retrieval and releases capacity as soon as all its configured outputs
are downloaded. Local media validation follows
deletion. Inputs, native workflows, fixed seeds, model definitions, timings,
output hashes and cleanup status are retained in private run artifacts.
Artistic quality and reference adherence remain separate, unscored review
criteria; execution success is not a quality verdict.
For repeated iterations, retain the first run with --cleanup=false, then pass
--reuse-run /absolute/path/to/that/run --cleanup=false. Reuse requires matching
declared installations, recorded provisioning fingerprints and exact live
ownership; it never allocates a fallback. Fingerprints cover installed node
source and requirements contents, runtime settings and the startup template.
Runs without fingerprints cannot be reused.
Each iteration records new cases, workflows and sampling in a separate result
directory while preserving the original instance and prior results. Retention
continues billing outside controller deadlines; release requires explicit cleanup.
Loopback E2E checks exercise matrix pooling, offer reuse, namespace exclusion
across output directories, duplicate-seed rejection, parallel completion,
failures, interruption, lost
creation acknowledgments, cleanup recovery and the real authenticated CLI’s
upload/conversion/native-queue/download path, plus descendant cancellation. They never rent capacity or prove
GPU model quality. Runtime composition currently supports the maintained
CLIPTextEncode-based SDXL and HiDream graphs; unsupported workflow bindings
fail before allocation. The authenticated CLI bridge requires Linux procfs.
13.1 - Buffered ComfyUI experiments
//projects/comfyui_tools/cmd/experiments runs arbitrary workflows against an
existing endpoint through the native ComfyUI CLI. It maintains one executing
job plus a configurable pending buffer after warm-up, independently observes
completion and downloads original media. It does not provision instances,
install models or manage credentials. The caller supplies an authenticated CLI
and a producer containing a finite set of ready candidates. The
experiment skill owns the direction,
evaluation, scrap/refine/fork procedure. Queue buffering schedules ready work;
it does not evaluate outputs or authorize endless successor generation.
Build the executable and any launchers before starting the sustained process:
bazel build //projects/comfyui_tools/cmd/experiments
bazel-bin/projects/comfyui_tools/cmd/experiments/experiments_/experiments \
run --config /absolute/task/config.json --directory /absolute/task/run
The runner requires Linux process groups and advisory file locking. Child
commands receive literal argv without shell expansion and inherit the caller’s
environment. Use absolute paths for executable wrappers and all inputs. Do not
start nested bazel run children beneath a long-lived Bazel invocation; build
first or prepare a --script_path launcher. Live runtime commands need network
access; builds and E2E fixtures do not.
Configuration and producer contract
{
"cli": ["/absolute/authenticated-comfy"],
"producer": [
"/absolute/workflow-producer",
"--matrix",
"/absolute/matrix.json"
],
"queued_buffer": 2,
"max_experiments": 12,
"timeout_seconds": 3600,
"duplicate_attempts": 8
}
For a separately and explicitly authorized continuous stream, replace max_experiments with
"continuous": true. The two modes are mutually exclusive. Iterative direction development uses
finite runs and review before successor jobs; an earlier utilization request
does not select continuous mode. Buffer defaults
to two pending jobs, timeout to 3600 seconds per subprocess operation, and
duplicate attempts to eight. The timeout includes native queue waiting; allow
enough time for the configured lookahead. Native execution can continue after
a local timeout or interruption.
The producer receives one JSON object on stdin:
{ "sequence": 0, "directory": "/absolute/task/run/000000" }
It writes exactly one JSON object on stdout, with diagnostics on stderr:
{
"workflow": "/absolute/task/run/000000/candidate.json",
"description": "Compare raking light with the earlier diffuse-light composition",
"identity_exclusions": ["/7/inputs/seed", "/10/inputs/filename_prefix"],
"notes": {
"positive_prompt": "A geometric still life in raking light",
"negative_prompt": "blur"
}
}
The workflow is a native UI or API JSON object, at most 64 MiB. The producer
owns model bindings, parameters, reference files, prompts and batch size; no
such fields are hard-coded into the runner. Return {"done":true} to end
the stream gracefully. Sequence numbers are monotonic requests, including
rejected duplicate candidates, rather than counts of accepted jobs.
Stop is rechecked after a producer returns and before submission, so a drain
requested during a slow producer does not add another job.
The runner snapshots exact workflow bytes before submission. Duplicate
identity is canonical JSON after removing explicitly declared JSON-pointer
fields. Object fields are removed; array positions become null so indexes do
not shift. Every pointer must exist; root exclusions are forbidden. Exclude
seeds, output prefixes and irrelevant UI bookkeeping consistently. Keep
meaningful parameters in the identity. This detects declared structural
duplicates; the producer and agent still assess useful semantic variation.
Ownership, interruption and control
The private run directory contains journal.json, a single-controller lock,
per-experiment native receipts and workflow snapshots, original media/, and
gallery.html with collapsed notes, prompts, settings and hashes. Journal decoding supports the records its writer can produce, including
journals larger than 64 MiB. Opaque numeric notes retain their exact JSON
values through execution, restart and report generation. Directory
permissions are restricted to the current account. CLI captures are bounded
and raw diagnostics never enter the gallery. Inspect inputs and notes for
protected data before sharing any artifact.
experiments status --directory /absolute/task/run
experiments stop --directory /absolute/task/run
experiments stop --directory /absolute/task/run --cancel-owned
stop writes a control request for the running controller to drain. Explicit
--cancel-owned additionally targets only recorded outstanding prompt IDs
through native jobs cancel; an idle run consumes the request when resumed.
Cancellation is reconciled against the exact native job status: a rejected
interrupt retains ownership, and a job that completed before cancellation
retains artifact collection. A successful cancel command alone is not proof
of termination. No operation clears the global queue or changes an instance.
SIGINT/SIGTERM stop local subprocess groups and preserve remote jobs. Resume
with the same configuration and directory. Recorded prompt IDs are observed
again without resubmission. A durable successful submission receipt can recover
an ID after interruption before journal update. A missing acknowledgment is
recorded as submission_unknown and prevents automatic new submissions.
Inspect the private receipt and endpoint before any manual reconciliation.
A valid successful CLI envelope followed by a wrapper cleanup error retains
the acknowledged result and sets cleanup_warning; it is never blindly
resubmitted.
Retrieval transport failures get at most three attempts, with one- and
two-second delays and fresh artifact directories; generation is never
resubmitted by those retries. Invalid or escaping media is rejected immediately.
Producer, native job and exhausted artifact failures stop replenishment and retain
failure phases for inspection. Observer transport errors and timeouts retain
the owned ID in observation_failed, so restarting can observe it again or
apply an owned cancellation request. These errors do not establish a terminal
native outcome. Confirmed failure and cancellation summaries in unsuccessful
wait envelopes remain terminal across restart. A new configuration needs a new run after owned
work has been reconciled; do not use a new directory to evade an ambiguous
submission. Control requests persist, including across restarts.
queued in the local journal means submitted and awaiting a terminal native
observation. It does not distinguish executing from pending or establish GPU
utilization. Observe the endpoint for that distinction. Slow producers,
authentication, endpoint outages or insufficient lookahead can still exhaust
the buffer. Original outputs and execution success do not establish visual
quality, text accuracy or reference fidelity.
Verification
bazel test //projects/comfyui_tools/test/experiments:experiments_test
Command-level fixtures verify buffering during slow downloads, seed-only
duplicate rejection, restart without resubmission, concurrent-controller
exclusion, lost acknowledgments, explicit producer exhaustion, cleanup errors,
owned cancellation, failed jobs and escaping media. They emit JSON receipts
under Bazel’s undeclared test outputs. They use no live endpoint, credentials
or rentals. The agent skill covers
useful variations, feedback, queue observation and visual review.
13.2 - Chained image to image GIF
This output node uses native ComfyUI sampling and VAE decoding to create one
frame for each Prompt Sequence line. Each decoded frame is VAE-encoded as the input
to the next frame. The initial image is a starting condition, not an extra frame.
Negative conditioning and sampling settings are shared. frame_source selects
the previous decoded image or the original reference for each frame;
frame_seed_mode selects incrementing seeds or fixed noise. Saved nodes without
these controls retain previous-frame feedback and incrementing seeds. Original
reference plus fixed noise reduces accumulated drift and makes identical
first/last prompts suitable for a controlled loop boundary. Neither control
supplies a motion trajectory. Start with denoise 0.45, 40 steps and 6 fps for full Chroma.
The complete chain is one dependent queue job. Ordinary panel sequences also
stay in one job to keep their media grouped. GIF frame prompts describe successive changes to
the same scene; this is discrete img2img chaining, without motion interpolation.
Lower denoise preserves more of the preceding frame; higher denoise changes it
more. GIF uses a 256-color palette per frame and frame intervals rounded to
10 milliseconds. All frames are retained, including identical adjacent frames.
The GIF is assembled inside the ComfyUI output node and uses its native animated
preview. No external assembly step is required.
The image-to-image-gif-masked workflows add native ComfyUI masks so only an
editable rectangle receives denoising. Adjust its size, position and feathering
around the intended moving subject. Eval cases own their rectangle in output
pixels. Qwen’s GIF workflows condition every frame on the selected image
through its native image-edit encoder; they start at denoise 1, CFG 4 and 40
Euler/simple steps.
The node uses Torch, NumPy and Pillow already installed by ComfyUI. It does not
download software. A single initial image is required. Sampling errors and
interruptions do not publish a partial GIF. Files use native output naming,
stay within the output directory and never overwrite an existing GIF.
Frame decoding uses ComfyUI’s native VAEDecode normalization, including Qwen’s single-frame temporal VAE output. CPU frames are converted to float32 for
NumPy/Pillow encoding. This compatibility path is covered by the real-GIF
fixture; successful GPU generation remains separate acceptance.
The separately packaged Qwen GIF node consumes raw frame instructions, a Qwen
text encoder and the initial image. In previous-frame mode it feeds each
decoded result through the native Qwen image-edit encoder for the next
positive/negative conditioning, and through VAE encoding for that frame’s
sampler input. This remains genuine image feedback at denoise 1. The
original-reference control remains available for independent-edit comparisons.
The existing generic node retains its saved-input interface.
13.3 - ComfyUI workflow nodes
This package owns the Prompt Sequence implementation, its
native multiline text box and offline checks. In line mode, each nonempty line
is one panel; blank and whitespace-only lines are ignored. Terraform stages its Python source through the existing native
ComfyUI provisioner; the repository Python library is only for offline checking.
One optional multiline negative prompt is shared across every panel without
splitting or adding the positive context. It is appended to the existing inputs;
the third output is scalar text, while prompt and filename outputs retain their
original list slots. Existing four-input workflows remain accepted with an empty
negative output.
One Run stays one native ComfyUI job, so its outputs stay grouped in media.
Every run gets a fresh UUID prefix, for example
comic_5ba8d9cae1374e90aeed4482cf57841c_001; the remaining panels use the same
UUID and increasing suffixes. Unchanged text queued again creates a new run
identity rather than reusing cached output filenames.
Current sequence workflows pass their model through the node’s optional MODEL
input/output. A wrapper on a cloned native model patcher displays Panel 2 of 3
as native sampler progress text while the sampler’s step counter continues to
work. Sampling and conditioning are unchanged. Older graphs retain their first
three output slots and still work; import the current workflow to add the model
connection required for panel progress. No browser extension is installed.
See the workflow instructions
for panel input and the boundary between shared references and panel continuity.
13.4 - Danbooru tag search
Local prompt-tag lookup in ComfyUI
Search from a terminal with the bundled index and no ComfyUI server.
bazel run //tools/comfyui:tags -- 'blue hair' --limit 10
The CLI prints comma-separated tags with prompt spaces. Use --raw-tags for
CSV spelling, --sort popularity for post-count ordering, or
--include-deprecated to include retired tags.
ComfyUI App and graph
Build the optional installation bundle and the workflow catalog.
bazel build //projects/comfyui_tools/nodes/danbooru_tag_search:installation \
//projects/comfyui_tools/workflows:workflows
Extract bazel-bin/projects/comfyui_tools/nodes/danbooru_tag_search/danbooru_tag_search.tar.gz
into your ComfyUI directory and restart ComfyUI. The archive installs the search
node with its full tag vocabulary under custom_nodes/danbooru_tag_search/.
Import bazel-bin/projects/comfyui_tools/workflows/danbooru/danbooru-tag-search.app.json
for App mode or the matching danbooru-tag-search.json for Graph Mode.
Enter a tag or a fragment such as blue hair and run the App. Spaces match
underscores and the query is case-insensitive. Sort by defaults to relevance,
which places exact matches first, then prefixes and other substring matches.
Popularity ranks all matches by descending post count. Turn on Prompt spaces
to copy tags such as blue hair into NoobAI, or turn it off to retain CSV names
such as blue_hair. The bundled App and graph enable prompt spaces by default.
Use Limit to set the number of results and Include deprecated to search
retired tags. Copy the results or download the text file. Searches run locally with no model
or GPU and save their text results through ComfyUI’s native Save Text node.
The bundled CSV is the unchanged Danbooru vocabulary from
DeepGHS site_tags under
CC BY 4.0. The
dataset download target
records its pinned revision and checksum.
13.5 - Image sequences
Image Sequence generates ordered still images in one ComfyUI job. Each scene
starts from fresh noise. Further actions edit the previous decoded image, while
the graph’s original IP-Adapter references remain active. It saves each completed
PNG immediately, before starting another action. Cancellation leaves completed
files in ComfyUI’s output directory.
Use one complete desired-image prompt per line, with --- alone on a line to
start a new scene. Blank lines provide spacing and do not create images. Scene
breaks reset composition, not references or shared appearance text. NoobAI is a
tag-oriented generator: describe the desired result rather than writing only an
edit command such as “move the hand”.
Sequence References provides one required appearance reference, two optional
views and an optional continuation image. (none) omits an optional input.
Reference views are fitted inside 512-square canvases with edge padding, preserving
their full contents. All references influence the whole image; this is not
per-character region assignment. Continuation retains its original pixels until
the sampler resizes it to the requested canvas.
For a partial run, keep the complete action list, set start_image to its absolute
action number and image_count to the wanted number (0 means all remaining).
Starting inside a scene requires its accepted preceding image in continuation.
Starting at a scene boundary ignores continuation and creates a fresh composition.
The seed is the base seed plus the absolute action index, modulo 2^64. Keep the
seed control fixed to repeat a run; extending the list does not change earlier
action seeds. Inserting or deleting earlier actions changes later indices.
Change strength starts at 0.45. Lower values retain more composition; higher
values allow larger changes. Scene starts always use 1.0. References reduce
appearance drift but do not guarantee identity, anatomy or action fidelity.
Each PNG includes the native workflow/prompt metadata and an image_sequence
record of its actual scene/action, seed, effective prompts and sampler settings.
Filenames share a fresh run identifier and contain ordered scene/action numbers.
The native App gallery receives all completed results when the job finishes;
files from interrupted runs remain on disk even when the job has no final gallery.
After the run finishes, one combined GIF plays all generated images in action
order. The App exposes gif_frame_duration_ms, initially 500 milliseconds per
image; values from 20 to 10000 in multiples of 10 are accepted. PNGs and GIFs share
the run identifier. GIFs use the already-saved PNGs, keep their dimensions and
add no intermediate motion when interpolation is disabled. Identical adjacent images can share an encoded frame
with a combined hold time. Partial runs contain only their newly generated images.
Per-scene GIFs are not published. Interruption preserves completed PNGs and
does not publish an incomplete GIF. The native gallery includes the stills and
the combined animation.
Optional control_net receives the approved NoobAI Canny model. Within a scene,
native Canny extracts edges from the resized preceding image and native
ControlNet conditions both positive and negative prompts. control_strength
defaults to 0.35; zero disables it. control_end defaults to 0.8. Scene starts
skip this guide. Lower the strength for larger pose changes; edge guidance can
resist them and does not guarantee identity or temporal consistency.
interpolation_multiplier accepts 1 (disabled), 2, 4 and 8. The App defaults to
4x and requires the configured Video2X 6.4.0/RIFE 4.25 installation and Vulkan
device. RIFE smooths each scene separately; the combined GIF retains hard scene
cuts. Scene playback duration is preserved with GIF’s 10-millisecond precision.
The original PNGs remain untouched. Interpolation can distort inconsistent poses.
Native cancellation also stops interpolation and its child processes, removes
run-owned temporary media and retains completed PNGs.
The separate noobai-reference-sequence preset retains this reference/continuation
behavior, with Canny and smoothing disabled initially for inspection. The
noobai-scene-composer preset uses the same sampler/output node with
generation_mode=independent, seed_mode=fixed, 25 first-pass steps and 20
refinement steps at denoise 0.4. Every first pass starts from fresh noise; its
second pass consumes only that image’s sampled latent, with the same seed and
conditioning. Zero refinement steps disables the second pass. The legacy node
defaults remain previous-image generation, incrementing seeds and no refinement.
Scene Prompts combines fixed character, clothing and style descriptions with
one setting per scene and one action per line. A single setting applies across
all scenes; any other count mismatch fails before sampling. --- still groups
scenes for settings and hard playback cuts. An independent partial run needs no
continuation image. The composer has no image-reference adapter or edge control.
Optional LoRA defaults to (none) and passes the model/CLIP pair unchanged.
Selecting an already-installed filename delegates to native LoraLoader with
separate model and text-encoder strengths. No model is downloaded. Shared tags,
fixed seeds and refinement do not guarantee character identity or better quality.
The NoobAI workflow instructions
describe importing the generated App. The runtime source is staged as one native
custom-node module. Interpolation additionally uses the repository-pinned
Video2X installation managed by the infrastructure owner.
ImagegenKeyframeGIF assembles an approved IMAGE batch without loading a model.
Use 2 to 128 equally sized poses, a frame duration divisible by 10 ms and an
interpolation multiplier of 1, 2, 4 or 8. Reversible playback traverses the poses
and returns to the first, allowing RIFE to smooth both directions. The node
retains each source as a PNG and publishes one looping GIF using the same writer
as image sequences. Interpolation requires the deployment’s existing Video2X
engine. Validate the poses first; neither reversal nor RIFE fixes incorrect edits.
13.6 - Image-generation evaluation cases
Each case owns its prompt, supplied reference and review criteria. The operator
approved publishing both cases and their assets. Both reference files retain their original operator-supplied bytes.
The thorn case depicts a forbidden burial ground of monumental artificial
thorns and one visibly impaled, flesh-covered adult corpse. Its reference guides
architectural form; the text directs a low viewpoint, asymmetric silhouettes,
selective painterly edges and harsh raking light. The architecture dominates,
while a legible chest wound, dead face and hanging posture provide a shocking
second reading. Emotional intensity has its own review criterion; darkness and detail
alone do not establish it. A skeleton or bare skull fails subject adherence.
Compare text-only and reference-guided results with the same seeds.
The plush case requests visible petting motion and a seamless loop. Frame
prompts describe successive static hand poses, with identical first and last
poses. Its edit_region selects the hand area for masked comparisons. The matrix
compares chained feedback, original-reference sampling and native Qwen editing;
it does not imply a trained video model or guarantee smooth motion.
Its sketch comparison provides a corrected structural
input and a staged sketch-only/appearance-reference procedure. This separate
diagnostic does not run as part of the existing GIF matrix.
Execution, media validity, timings and cleanup can be checked automatically.
Review requested subject, style, reference adherence and artistic quality
separately on a 0–4 scale: absent, weak, partial, mostly achieved, consistently
achieved. Leave unreviewed scores null. Valid files are not quality acceptance.
Deployment configuration and credentials belong to infra/image_gen/evals.
Generated outputs and reports belong to the configured ignored output directory.
13.6.1 - Plush petting sketch comparison
reference.jpg retains the original operator-supplied photograph.
lift-sketch.png is a prepared structural input with one
continuous head outline and a visible gap beneath the entire raised hand.
The sketch is not a Qwen output or a successful animation frame. It simplifies
some details and is not a pixel-aligned mask for the original photograph.
Use these inputs in order:
- Upload
lift-sketch.png and open qwen-sketch-reconstruction. Run the default
full-strength reconstruction and inspect the raw PNG. Reject contact, a second
hand, a second crown, disconnected anatomy or a different scene layout. - Once that baseline succeeds, upload
reference.jpg and open
qwen-structure-guide-edit. Image 1 remains the same sketch; image 2 adds the
original appearance. Keep prompt, seed, negative text and sampling settings
identical to the baseline. Compare QwenStructureGuideRaw with the baseline
before looking at the optional composite. - If only the second run fails, investigate reference competition. If the
baseline also fails, investigate sketch reconstruction before producing a
sequence. A successful file or graph execution is not visual acceptance.
The checked-in graphs share the default prompt and sampler configuration.
Edits made separately after import do not synchronize automatically. The
baseline requires only the sketch; both retain native semantic and VAE image
conditioning on positive and negative branches. The appearance workflow also
restores original dimensions and produces a feathered composite using the
existing repair rectangle. Adjust that rectangle to cover the complete movement;
compositing cannot repair pose drift, differing outlines or changed framing.
Sketch provenance and limitations
The built-in image generation editor prepared this input on 2026-11-16 using
the exact asset preparation prompt. Its input was the
white-background scene sketch from the rejected native-reference trial,
SHA-256 81ce3fbee43e508b5caa510de445fe5c893eaf8355ec797ffb6c5567bef1d36f.
That source combined native Canny edges from the public photograph with moved
hand contours and an added crown curve. Inspection found a conflicting retained
outer hair contour; the repaired asset removes that ambiguity. The trial record
retains its lineage and failed Qwen outputs.
The repaired asset is an opaque RGB PNG, 1297 by 1213 pixels, SHA-256
c19aa520a4cc2ee4c809921bd639a3987bcbbb93927958ad71e6fa037610176c.
Visual inspection confirms a single connected forearm/hand silhouette, one
rounded crown and a continuous gap. The native Qwen trial
records the subsequent GPU comparison: the default sketch-only reconstruction
retains the gap and coherent anatomy, while adding the original restores its
appearance but introduces unwanted crown folds. Preserve the two variants and
compare them at identical settings. Neither command success nor the improved
still establishes a finished animation.
The same trial also tests this targeted negative text with the original positive
prompt unchanged in both variants:
animal ears, raised ear-like folds on the plush's head, horns, hats, cushions above the hair
It retains a clean sketch-only reconstruction but does not remove the folds
with the original appearance reference. It is a recorded experiment, not the
default or a verified correction. The saved workflows retain editable negative
prompt fields and the original blank default.
Other poses and animation
The default prompt describes the supplied lifted-hand sketch. For a contact or
pressing guide, replace its hovering and air-gap instructions with the contact,
finger curvature and head compression shown in that guide. Keep image 1 as the
target geometry and image 2 as original appearance. An unchanged example prompt
can contradict a new sketch.
Approve the sketch motion before reconstructing its distinct poses. Inspect the
raw photographs before optional compositing or interpolation: the contact-pose
trial preserves hand placement but changes finger arrangement and portal
texture between frames. The existing rectangular composite can introduce seams.
Fixed seeds and shared appearance references do not guarantee temporal stability.
Photographic pose guides are another input to qwen-pose-guide-edit: prepare a
clean background and a separate hand layer, place the hand at each target pose,
then refine each guide with the original appearance reference. This preparation
is separate from Qwen sampling. In the visible-motion trial,
the image editor prepares the layers and FFmpeg positions them. The earlier
drawn sketch is not an input to that trial.
The trial keeps seed 42, 40 Euler/simple steps, CFG 4 and blank negative text.
Start by comparing the lifted and pressed raw outputs at denoise 0.7; the
instruction must preserve either a gap or contact according to the current
guide. Lower denoise can retain more of the guide, including its defects: 0.45
removes one extra digit but fails to fix a separate skin-texture artifact.
Inspect all poses and omit rejected outputs before RIFE assembly. Larger
movement exposes the hand-layer warp’s unnatural forearm shape, which Qwen can
preserve. The resulting loop demonstrates visible motion, not stable natural
anatomy.
13.7 - Qwen chained image to image GIF
This node refreshes Qwen’s positive and negative image-edit conditioning from
each preceding decoded image, and VAE-encodes those same pixels for the next
frame. The shared chained_img2img_gif node owns sampling, decoding, progress
and GIF publication. Both first-party node directories must be enabled; the
native registry resolves the shared node when the workflow is inspected or run,
so custom-node import order does not matter.
Only Qwen evaluation rentals install this model-specific node. Other models
retain the shared renderer without carrying Qwen code in their startup payload.
This uses ComfyUI’s installed native Qwen encoder and adds no external package.
The shared real-GIF fixture exercises its reference and latent feedback.
14 - Dotfiles
Personal configuration files with installation and comparison commands
This project packages personal configuration files into an installable
archive. Make and Bazel entry points compare the packaged files with the
local system and install selected configurations.
Links
Features
- Archive with dotfiles that can be installed using make
Bazel usage
bazel run //projects/dotfiles:help # Show help
bazel run //projects/dotfiles:diff # Show diff
bazel run //projects/dotfiles:install # Install files
Archive usage
oras pull --output "${PWD}" docker.io/alwaldend/src:projects_dotfiles_dotfiles_tar_head
cd releases/projects/dotfiles/head/files
tar -xf dotfiles.tar
cd dotfiles
make help # Show help
make diff # Check diff between system files and those from the archive
make diff/nvim # Check diff for all nvim files
make diff/nvim/.config/nvim/lazy-lock.json # Diff specific file
make install # Install all files from the archive
make install/nvim # Install nvim files
make install/nvim/.config/nvim/lazy-lock.json # Install a specific file
Help
help: Show help
install: Install files from the archive
diff: Show diff between archive files and system files
install/bin: Install bin files
diff/bin: Diff bin files
install/home: Install home files
diff/home: Diff home files
install/nvim: Install nvim files
diff/nvim: Diff nvim files
make: Nothing to be done for 'help'.
15 - Icon generator
Generate random patterns of colored squares or circles as PNG icons
Icon generator is a Go CLI that creates random grid patterns as PNG images.
Choose the canvas dimensions, background, palette, cell size, density,
clustering algorithm and strength, and square or circular shapes. Rendering and PNG encoding use
only Go’s standard library; no external graphics programs or libraries are required.
Usage
From the repository root, create an output directory and generate an icon:
mkdir -p out/icon_generator
bazel run //projects/icon_generator -- \
--width 256 --height 256 \
--background '#f5f1e8' \
--colors '#223843,#d77a61,#e3b23c' \
--pixel-size 16 --pixel-shape square \
--density 0.4 --seed 42 \
--output "$PWD/out/icon_generator/squares.png"
For circles on a transparent background:
bazel run //projects/icon_generator -- \
--background transparent \
--colors '#223843,#d77a61,#e3b23c' \
--pixel-shape circle --seed 42 \
--output "$PWD/out/icon_generator/circles.png"
Use an absolute output path with bazel run. The output directory must
already exist. Existing files and symlinks are never overwritten; choose a
new path when repeating a command.
Use --clusterization 0.75 for compact groups. To grow winding, branching strands
while keeping the same number of occupied cells, also select
--clusterization-algorithm strands. Sparse densities leave more room for open gaps:
bazel run //projects/icon_generator -- \
--width 512 --height 512 \
--background '#212121' --colors '#ffffff' \
--pixel-size 16 --pixel-shape circle \
--density 0.2 --clusterization 0.75 --clusterization-algorithm strands --seed 42 \
--output "$PWD/out/icon_generator/clustered.png"
For replication from a sparse initial population of individual white pixels:
bazel run //projects/icon_generator -- \
--width 1024 --height 1024 \
--background '#212121' --colors '#ffffff' \
--pixel-size 1 --pixel-shape square \
--density 0.03 --clusterization 0.4 --clusterization-algorithm replication \
--replication-inheritance 0.9 --replication-forward-bias 0.8 \
--replication-crowding 0.75 --replication-branching 0.15 \
--replication-field-scale 128 \
--replication-growth-variation 0.08 --replication-seeding-variation 0.75 \
--seed 42 --output "$PWD/out/icon_generator/replication.png"
Build the executable with bazel build //projects/icon_generator.
It can also run directly, without Bazel or other programs on PATH:
bazel-bin/projects/icon_generator/cmd/icon_generator/icon_generator_/icon_generator --help
For long, gradually curving stems with shorter side branches, select tips and
start with a much sparser population. Density 0.00015 gives about 157 starting
cells on a 1024-square, one-pixel grid:
bazel run //projects/icon_generator -- \
--width 1024 --height 1024 \
--background '#212121' --colors '#ffffff' \
--pixel-size 1 --pixel-shape square \
--density 0.00015 --clusterization 0.9 --clusterization-algorithm tips \
--seed 42 --output "$PWD/out/icon_generator/tips.png"
Options
| Option | Default | Meaning |
|---|
--width | 256 | Output width, 1 through 4096 pixels |
--height | 256 | Output height, 1 through 4096 pixels |
--background | #ffffff | Opaque #RRGGBB or transparent |
--colors | #000000 | Nonempty comma-separated #RRGGBB palette |
--pixel-size | 16 | Square side or circle diameter, 1 through 4096 pixels |
--pixel-shape | square | square or circle |
--density | 0.4 | Average initial cell occupancy probability, from 0 through 1 |
--clusterization | 0 | Clustering strength, replication probability, or tip growth length, 0 through 1 |
--clusterization-algorithm | compact | compact, strands, replication, or tips |
--replication-inheritance | 0 | Probability a child keeps its parent-to-child heading, 0 through 1 |
--replication-forward-bias | 0 | Strength of forward and gentle-turn preference, 0 through 1 |
--replication-crowding | 0 | Strength of preference for less crowded destinations, 0 through 1 |
--replication-branching | 0 | Probability the second child favors a sideways fork, 0 through 1 |
--replication-field-scale | 128 | Approximate regional variation scale, 1 through 4096 logical cells |
--replication-growth-variation | 0 | Maximum local offset to reproduction probability, 0 through 1 |
--replication-seeding-variation | 0 | Regional starting-population contrast, 0 through 1 |
--seed | Fresh random seed | Unsigned 64-bit seed; zero is valid |
--output | icon.png | Destination PNG file |
--help | | Print usage without generating an image |
Hex colors are case-insensitive. Quote colors so the shell does not interpret
# as a comment. Palette colors are opaque and keep their exact RGB values.
Rendering and reproducibility
Canvas dimensions count output image pixels. Logical pixels occupy a grid
starting at the top-left corner. A 256 by 256 canvas with size 16 contains
16 by 16 cells. Squares fill their cell; circles are centered within it and
leave the background visible at the corners. Shapes have hard rasterized
edges, so very small circles can resemble squares. Partial cells at the
right and bottom are clipped without resizing the shape or padding the image.
Initial placement independently samples each cell. Its probability is the requested
density, or a local probability when regional seeding is enabled. These local
probabilities average to density. Each shape uses a randomly selected palette entry.
Density is a probability, not an
exact shape count: zero draws only the background and one occupies every
cell. Circle corners remain background even at density one.
The algorithm determines how positive clusterization changes placement:
compact (default) moves occupied cells to increase neighboring contacts.
Higher factors make more attempts and cannot decrease the number of occupied
neighbor pairs with the same seed and other settings. Cell count is preserved.strands grows winding strands with occasional branches. Higher factors favor
longer strands; placement prefers uncrowded cells to leave open gaps. Cell count
is preserved, but the neighbor count can rise or fall. Dense or tiny canvases
have less room for open strands.replication uses density for the initial population and clusterization as the
base probability that each cell reproduces, optionally varied across regions.
Reproduction adds exactly two distinct
children chosen randomly from the parent’s empty adjacent cells. A cell with
fewer than two vacancies adds none. A cell that dies adds none and remains
visible. Children get the same one-time decision, so final coverage can exceed
the initial density; high reproduction probabilities can fill most of the image.
Initial cells are processed in row order, followed by children in birth order.
Each cell is processed once, and growth stops when no decisions remain.tips uses density for the starting population and clusterization to scale
growth length. Tips usually extend one adjacent cell along a gradually turning
heading. Occasional forks divide the remaining growth budget, giving a smaller
share to a side branch. The main tip grows before its deferred branches.
Tips stop at exhausted budgets, canvas edges, occupied destinations, or contact
with existing paths. The recent trail and a small fork junction are exempt
from contact stopping so curves and branches can leave their own stem.
Initial cells are processed in seeded shuffled order and remain visible.
Final coverage can exceed initial density; higher factors do not guarantee
more coverage because collisions can stop growth. Replication controls have
no effect on tips. Try density 0.00005 through 0.0008 for individual pixels on
a 1024-square canvas; dense initial populations leave little room to grow.
Growth uses all eight neighbors: horizontal, vertical, and diagonal. Opposite
canvas edges are not neighbors. Diagonally adjacent circles count as neighbors
even though their shapes do not physically touch at the corners. The result can
contain several groups and isolated cells; no factor promises one connected group.
Zero disables reproduction and preserves the original independent pattern when
regional seeding is off. Explicit regional seeding can change that initial pattern. Compact
and strands can change positions and colors within the configured palette.
Replication and tips retain each initial cell and its color; children use the palette.
Replication growth controls
The four placement controls default to zero, which reproduces the original
uniform-neighbor rule when regional variation is also off. They are validated for every algorithm but affect only
replication. They change placement, while --clusterization still controls
reproduction probability and --density still sets the initial population.
Inheritance gives a newborn its parent-to-child direction with the configured
probability; otherwise it gets a random direction. Roots start with random
directions. Forward bias uses those directions to favor continuing forward or
turning gently, with weaker preferences for sideways or backward growth.
Use inheritance together with forward bias to encourage persistent paths.
Inheritance alone has no visible effect when forward bias is zero.
Crowding avoidance lowers the weight of destinations surrounded by more occupied
neighbors. It excludes the parent and counts the first child when placing the
second. This is a soft preference: crowded vacancies remain eligible.
Branching controls how often the second child favors a direction 90 degrees to
either side of the first child’s direction. It controls the fork angle, not the
number of children. Every successful reproduction still adds exactly two children;
if fewer than two vacancies exist, it adds none. Children can continue reproducing.
Controls do not promise thin or connected strands. High initial density or
reproduction probability can still fill gaps. Different placements can change
later vacancy availability and final coverage, so comparisons should keep the
seed, density, and reproduction probability fixed and report final coverage.
Regional variation
Seeding and growth variation use the same seed-derived smooth field, so fertile
and quiet areas line up. --replication-field-scale sets their approximate size
in logical cells: 128 means about 128 output pixels with pixel-size 1, or 1024
output pixels with pixel-size 8. It is not an exact region diameter. Smaller
values vary more rapidly; larger values form broader regions.
--replication-growth-variation bounds the local additive change to reproduction
probability. For example, base clusterization 0.5 and variation 0.1 keep local
probabilities within 0.4..0.6. Values are clamped to 0..1, so their mean can shift
near those limits. Base clusterization zero always disables reproduction.
--replication-seeding-variation controls the contrast of the starting population:
zero is uniform, while one uses the strongest regional contrast that keeps all
initial probabilities within 0..1. Their average remains the requested density,
including partially clipped cells, but the sampled cell count is still random.
Seeding variation works with clusterization zero, allowing the starting population
to be inspected separately. Empty/full density remains empty/full, and a constant
field uses uniform probabilities.
Both variation strengths default to zero, preserving earlier seeded images.
Regional options affect replication only and add a normalization pass over the
logical grid without allocating a full-canvas field buffer. Strong growth
variation can fill favorable areas; moderate values preserve more internal gaps.
Successful invocations print seed: NUMBER on stderr. Reuse that seed with
the same settings and generator version to reproduce the decoded pixels.
PNG compression bytes may change between Go toolchain versions. Different
seeds are not guaranteed to yield different images.
Invalid options fail before output creation. Output errors return a nonzero
status with a diagnostic, and a failed write removes the incomplete file
created by the invocation. The dimension limits bound the main image buffer
at 64 MiB. Clustering uses at most another 16 MiB for the cell grid. Replication
also uses a queue of up to 64 MiB; tips uses a root-index list of up to 64 MiB
and a bounded per-root branch frontier. Encoding and the Go runtime use additional memory.
Verification
bazel test //projects/icon_generator:test
The end-to-end suite runs the built command with an empty PATH, decodes
its images, checks geometry and color behavior, and exercises failure paths.
Its Bazel undeclared outputs contain squares.png, circles.png,
transparent.png, clustered.png (strands), compact.png, replication.png,
replication-growth.png, replication-regions.png, tips.png,
and a manifest.json with replay arguments,
seeds, and checksums of decoded dimensions and RGBA pixels. They can be
inspected and recreated in a fresh directory.
Project page
15.1 - OpenSpec
15.1.1 - Specifications
15.1.1.1 - Random icon generation
15.1.1.1.1 - random-icon-generation Specification
Purpose
Generate PNG icons from random arrangements of configurable colored shapes,
with control over the canvas, background, palette, density, and seed.
Requirements
Requirement: Generate a PNG with configurable canvas dimensions
The icon_generator CLI SHALL accept --width, --height, and --output
and write one PNG with exactly the requested dimensions. Width and height
SHALL be integers from 1 through 4096, measured in output image pixels.
Generation SHALL work without installed image-processing programs or
external runtime libraries.
Scenario: Generate a rectangular image
- WHEN the user requests width 120, height 80, and an available output
path with otherwise valid options
- THEN the command exits successfully and writes a decodable 120 by 80
PNG to that path
- AND no image-processing executable is required on
PATH
The CLI SHALL accept --background as #RRGGBB or transparent, and
--colors as a comma-separated nonempty list of #RRGGBB colors. Hex digits
SHALL be case-insensitive. An occupied cell SHALL choose uniformly from
the supplied palette entries and use that opaque color for its shape.
Unoccupied cells and pixels outside shapes SHALL retain the background.
Rendering SHALL preserve palette colors without blended edge colors.
Scenario: Use a single foreground color
- WHEN the user selects a white background and a palette containing
only
#123abc - THEN every rendered shape pixel has opaque RGB color
#123abc - AND every remaining pixel is opaque white
Scenario: Preserve transparent background
- WHEN the user selects
--background transparent - THEN pixels not covered by a shape have alpha zero
- AND shape pixels have alpha 255
The CLI SHALL accept --pixel-size as an integer from 1 through 4096 and
--pixel-shape as square or circle. The grid SHALL start at the top-left
canvas corner with cells of the requested size. A square SHALL fill its
cell; a circle SHALL be centered in its cell with a diameter equal to that
size. A circle SHALL include an output pixel when that pixel’s center is
on or inside the circle. Shapes SHALL have hard rasterized boundaries.
The rightmost and bottommost cells SHALL be clipped at the canvas bounds
without changing their original shape size or center.
Scenario: Render square cells
- WHEN the user requests a 32 by 16 canvas, size 16, square shapes,
and density 1
- THEN two adjacent 16 by 16 squares cover the canvas
Scenario: Render a circle within a cell
- WHEN the user requests a 16 by 16 canvas, size 16, circle shapes,
and density 1
- THEN the cell contains a centered circle of diameter 16
- AND the canvas corners retain the background
Scenario: Clip incomplete edge cells
- WHEN the user requests a 25 by 18 canvas with size 16
- THEN the grid contains two columns and two rows
- AND shapes in the last column and row are clipped to the 25 by 18
output bounds without padding or shrinking the shapes
Scenario: Render the smallest logical pixel
- WHEN size is 1, density is 1, and the shape is either supported value
- THEN every output pixel receives a palette color
The CLI SHALL accept a finite --density from 0 through 1 inclusive.
Initial placement SHALL independently sample each cell. The per-cell
probability SHALL equal density unless regional replication seeding is enabled,
in which case density SHALL equal the mean of the local probabilities. Compact and strand clustering SHALL rearrange that sample without
changing its occupied-cell count. Replication and tips SHALL use the sample as their
initial population and MAY increase the count through growth. Density
SHALL represent an average initial occupancy probability, not an exact occupied-cell
count or the percentage of output pixels covered by circles.
Scenario: Generate only background
- WHEN density is 0, with any valid clusterization and algorithm
- THEN every output pixel retains the configured background
- AND growth does not introduce a population spontaneously
Scenario: Occupy every cell
- WHEN density is 1, with any valid clusterization and algorithm
- THEN every cell contains the selected shape
- AND circle boundaries still leave background visible outside circles
Requirement: Reproduce a pattern from its seed
The CLI SHALL accept an optional unsigned 64-bit integer --seed, including
zero. For the same tool version, seed, and rendering settings, the decoded
output dimensions and pixel values SHALL be identical. If omitted, the
command SHALL obtain a fresh seed and report the effective seed on stderr
so the user can reproduce the result. Reproducibility SHALL concern image
content, without requiring byte-identical PNG encodings across toolchains.
Scenario: Replay an explicitly seeded image
- WHEN two invocations use the same explicit seed and rendering options
but different available output paths
- THEN decoding both PNGs produces identical dimensions and pixels
Scenario: Replay an automatically seeded image
- WHEN an invocation omits the seed and the user repeats its rendering
options with the reported seed
- THEN the repeated image has identical decoded dimensions and pixels
Requirement: Provide usable defaults and help
The CLI SHALL default to width 256, height 256, background #ffffff,
palette #000000, pixel size 16, square shapes, density 0.4, a fresh seed,
and output icon.png. The CLI SHALL provide --help describing options,
defaults, accepted values, seed replay, and the distinction between output
pixels and logical grid cells. Help SHALL exit successfully without writing
an image.
Scenario: Generate an image with defaults
- WHEN the command is invoked without options and
icon.png does not
already exist - THEN it writes a 256 by 256 PNG using black 16 by 16 square cells,
a white background, and occupancy probability 0.4
Scenario: Inspect usage without generating an image
- WHEN the user invokes
--help - THEN the command describes all supported options and exits
successfully without creating or changing an image file
The CLI SHALL reject invalid dimensions, size, density, palette, background,
shape, seed, unknown flags, and unexpected positional arguments with a
nonzero exit status and a diagnostic on stderr. Input validation SHALL
complete before creating the output file. The command SHALL refuse to
overwrite an existing output file. File creation, encoding, and close
failures SHALL produce a nonzero exit status and a diagnostic; a failed
write SHALL remove only the incomplete output created by that invocation.
Scenario: Reject invalid rendering options without output
- WHEN a rendering option is invalid, such as a zero width, size 4097,
density
NaN, an empty palette, a malformed hex color, or shape triangle - THEN the command reports the invalid option and exits unsuccessfully
- AND it does not create an output image
Scenario: Preserve an existing output file
- WHEN the requested output path already exists
- THEN the command exits unsuccessfully and reports the conflict
- AND the existing file remains unchanged
Scenario: Report an unavailable destination
- WHEN the output parent directory does not exist or cannot be written
- THEN the command exits unsuccessfully and identifies the output error
The CLI SHALL accept a finite --clusterization factor from 0 through 1,
defaulting to 0, and --clusterization-algorithm as compact, strands,
replication, or tips, defaulting to compact. Zero factor SHALL prevent reproduction. With regional seeding disabled,
it SHALL preserve independent placement and existing seeded image content for
every algorithm. Explicit
strand selection SHALL preserve the current seeded strand behavior.
Compact clustering SHALL preserve the sampled occupied-cell count and favor
dense groups. Increasing the factor with the same seed and other options SHALL
NOT reduce the total eight-neighbor occupied pair count. Strand clustering
SHALL preserve the sampled count and favor winding strands with occasional
branches and open gaps at sparse densities; higher factors SHALL favor longer
strands without a monotonic neighbor-count guarantee. Replication SHALL use the
factor as the probability of reproduction as specified by its lifecycle.
Tips SHALL use the factor to scale growth length as specified by its lifecycle.
All algorithms SHALL use the eight surrounding positions: horizontal, vertical,
and diagonal. Adjacency SHALL NOT wrap across opposite canvas edges. Diagonal
circle cells SHALL count as neighbors even though their shapes do not touch at
corners. The CLI SHALL reject invalid factors and unknown or empty algorithm
names before creating an output file and SHALL describe selection in help.
- WHEN the user increases compact or strand clusterization with the seed and other options fixed
- THEN the number of occupied cells remains unchanged
- AND compact mode does not reduce the occupied neighbor-pair count
Scenario: Include corner neighbors
- WHEN two occupied cells meet only diagonally on the grid
- THEN they count as one neighboring pair for clustering
- AND square and circle shapes use the same grid adjacency definition
Scenario: Grow sparse organic patterns
- WHEN the user selects strands, sparse density, and strong clusterization
- THEN the pattern favors narrow winding strands, occasional branches, and open gaps
- AND identical settings and seed reproduce the pattern
Scenario: Preserve default output
- WHEN the user omits clusterization or explicitly sets it to 0, with regional seeding disabled
- THEN the decoded image matches the independent-placement behavior
- AND omitted algorithm selection remains equivalent to explicit compact for positive factors
Scenario: Reject an invalid factor
- WHEN clusterization is negative, greater than 1, nonnumeric, NaN, or infinite
- THEN the command exits unsuccessfully with a diagnostic and creates no image
Scenario: Reject an unknown algorithm
- WHEN the algorithm name is empty or unsupported, even with zero factor
- THEN the command reports the invalid selector and creates no image
Requirement: Reproduce cells into adjacent vacancies
In replication mode, each initial and newborn occupied cell SHALL receive one
reproduction decision with probability equal to the clusterization factor,
locally modified when regional growth variation is enabled. Zero base
clusterization SHALL disable reproduction even with regional growth variation.
Reproduction SHALL add exactly two distinct children chosen from the parent’s
currently empty eight-neighbor positions, uniformly when placement controls
are zero and with configured preferences otherwise. If fewer than two positions
are available, the cell SHALL add none. A death decision SHALL add no children
and SHALL NOT erase or recolor the parent. Newborn cells SHALL receive their own
decision. Cells SHALL never be processed more than once or overwrite occupied
positions, and processing SHALL terminate when no decisions remain.
Scenario: Produce exactly two children
- WHEN a cell reproduces and at least two adjacent empty positions exist
- THEN exactly two distinct adjacent positions become occupied
- AND the parent remains occupied and its children may subsequently reproduce
Scenario: Stop a branch
- WHEN a cell dies or has fewer than two empty adjacent positions
- THEN it adds no children and remains visible
Scenario: Preserve the initial population
- WHEN replication completes
- THEN every initial occupied cell remains unchanged
- AND the final population equals the initial population plus an even number of newborn cells
The CLI SHALL accept --replication-inheritance, --replication-forward-bias,
--replication-crowding, and --replication-branching as finite numbers from 0
through 1 inclusive, defaulting to zero. Help SHALL describe each option.
These controls SHALL affect only replication. Their zero defaults SHALL preserve
existing seeded image content when regional controls are also disabled, and valid values SHALL NOT alter compact or strand
output. Invalid values SHALL fail before creating an output file, even when the
selected algorithm does not use them.
Inheritance SHALL set the probability that a newborn keeps its parent-to-child
direction as its heading instead of taking a random heading. Roots SHALL start
with random headings. Forward bias SHALL favor forward and gentle turns over
sideways and backward choices relative to the heading. Inheritance alone SHALL
NOT change image content when forward bias and branching are zero.
Crowding SHALL softly favor destinations with fewer occupied eight-neighbors,
excluding the parent and including the first child when selecting the second.
Branching SHALL set the probability that the second child favors a heading
90 degrees to either side of the first child’s direction. All valid vacancies
SHALL retain positive selection weights; these controls SHALL NOT add a new
reproduction rejection or permit partial births.
Scenario: Reproduce an existing image
- WHEN the four controls are omitted or explicitly zero and regional controls are disabled
- THEN replication produces the existing seeded image
- AND using the same controls and seed replays the same decoded pixels
Scenario: Grow with inherited direction
- WHEN inheritance and forward bias are enabled
- THEN children can continue outward using their inherited heading
- AND larger forward bias strengthens the forward preference
Scenario: Avoid crowded destinations
- WHEN crowding avoidance is enabled
- THEN more crowded destinations have lower relative weights than equally directed less crowded destinations
- AND a crowded destination remains eligible if it is vacant
Scenario: Favor sideways forks
- WHEN a reproduction decision selects sideways branching
- THEN the second child’s placement favors a quarter-turn from the first child’s direction
- AND two distinct children are still placed whenever two vacancies exist
Scenario: Validate controls independently of selection
- WHEN any replication control is negative, above one, nonnumeric, NaN, or infinite
- THEN the command fails with a diagnostic and creates no output for any algorithm
The CLI SHALL accept --replication-field-scale as an integer from 1 through
4096 logical cells, default 128, and --replication-growth-variation and
--replication-seeding-variation as finite values from 0 through 1, default 0.
All values SHALL be validated before output creation for every algorithm.
Only replication SHALL use regional controls. Both variation strengths zero
SHALL preserve all existing seeded image content regardless of field scale.
A seed-derived smooth field SHALL influence seeding and growth in the same
spatial regions. Scale SHALL determine the approximate distance over which
values vary, measured in logical cells. Growth variation SHALL bound the
additive deviation from the base reproduction probability before clamping to
[0,1]. Clamping MAY change the mean reproduction probability. Zero base
probability SHALL prevent all reproduction.
Seeding variation SHALL interpolate between uniform sampling and regionally
contrasted probabilities. The mean initial occupancy probability over the
logical grid SHALL remain density within floating-point precision. This SHALL
NOT require an exact occupied-cell count. Density 0 and 1 SHALL retain their
existing behavior. Constant fields SHALL fall back to uniform probabilities.
Regional seeding SHALL remain active when reproduction is disabled, and its
sample SHALL be retained even when all cells happen to be occupied or vacant.
Every logical cell, including a clipped edge cell, SHALL have equal weight in
the mean. The field SHALL be evaluated without a full-resolution field buffer.
Scenario: Produce regional variation
- WHEN the user enables seeding and growth variation
- THEN starting populations and reproduction probabilities vary gradually across the same regions
- AND repeated invocations with the same seed and settings reproduce the image
Scenario: Preserve average initial density
- WHEN regional seeding is enabled with reproduction disabled
- THEN the local initial probabilities average to density
- AND stronger seeding variation creates greater spatial contrast without promising an exact cell count
Scenario: Inspect the starting population
- WHEN clusterization is zero with regional seeding enabled
- THEN the output contains only the sampled regional initial population
- AND regional growth variation does not introduce births
Scenario: Handle narrow and degenerate fields
- WHEN the grid has one cell, one row, one column, clipped cells, or a field scale larger than its dimensions
- THEN generation remains finite and deterministic with probabilities within [0,1]
- AND density endpoints and paired births remain valid
Scenario: Reject invalid regional options
- WHEN field scale is noninteger or outside 1..4096, or a variation is nonfinite or outside 0..1
- THEN the command reports the invalid option and creates no image
Requirement: Grow persistent tips with asymmetric branches
The tips algorithm SHALL retain initial occupied cells and their colors and
extend eight-connected paths into vacant cells. A tip SHALL ordinarily add one
cell along a persistent, gradually turning heading. Occasional forks SHALL
create a side tip with a smaller remaining growth budget than the continuing
main tip. Tips SHALL stop on exhausted budgets, canvas boundaries, occupied
destinations, or contact with existing growth outside their recent trail and
local fork junction. Growth SHALL be finite without wraparound or overwrites.
Positive clusterization SHALL scale the available growth length; zero SHALL
preserve independent placement. Final coverage SHALL NOT be constrained to the
initial density or guaranteed monotonic in clusterization. Sparse starting
populations SHALL favor narrow winding paths with open gaps. Replication-specific
options SHALL NOT affect tips. The CLI SHALL describe tips and its density and
factor semantics. Existing algorithms SHALL retain their seeded behavior.
Scenario: Extend and branch from sparse roots
- WHEN tips is selected with sparse density and positive clusterization
- THEN paths grow from the sampled initial cells and can add a single child
- AND occasional forks allocate less growth to side branches than main tips
- AND every resulting connected component contains an initial cell
Scenario: Retain existing cells and replay growth
- WHEN a tips image is generated and then replayed with the same settings and seed
- THEN both images have identical decoded pixels
- AND every initial cell retains its palette color
Scenario: Stop in constrained space
- WHEN a tip meets existing growth outside its local trail or junction, or a canvas edge
- THEN it stops without overwriting cells or wrapping across the canvas
- AND single-cell, narrow, clipped, empty, and full grids terminate correctly
Scenario: Keep controls scoped to replication
- WHEN valid replication controls change while tips settings and seed remain fixed
- THEN the tips image remains unchanged
16 - Infinitime
InfiniTime firmware fork with a text watchface and Pomodoro app
This InfiniTime firmware fork adds a text watchface and a Pomodoro app. The
repository packages the pinned firmware source and its build dependencies.
Links
Features
- Extra Watchface:
Text - Extra app:
Pomodoro - C++, embedded
Usage
The root workspace declares the pinned firmware with use_repo_rule in
include.MODULE.bazel, preserving recursive Git submodules and the CMake
toolchain patch. Firmware source is fetched when referenced, rather than
during module resolution. The Python tooling manifest and native uv.lock live
in this project; npm and SDK archives retain their upstream pins. Python and
Node runtimes use the root workspace toolchains.
The standard pip extension reads the local uv.lock without fetching firmware.
The project re-exports npm with a separate extension identity so unrelated npm
targets do not fetch firmware to read its upstream lockfile.
bazel mod deps deliberately evaluates all extensions and can still fetch it.
native_uv.patch removes the upstream source’s pip-tools lock target. This
project owns the effective Python dependencies in pyproject.toml; update
them with //projects/infinitime:uv_lock.update using the shared
uv workflow. Explicit lock generation uses sandboxed
uv lock and requires network access to PyPI. Firmware builds consume the
checked-in native lock without running resolution.
Validate the firmware with bazel test //projects/infinitime:build_test.
The Python environment excludes ecdsa, whose optional key-signing support in
adafruit-nrfutil is unused by this project’s unsigned dfu genpkg commands.
This removes CVE-2024-23342
from the dependency graph. The helper does not support key generation or signed
DFU packages in this environment. Firmware image and DFU packaging continue
through the existing build workflow.
- Install Gadgetbridge
- Download the firmware:
oras pull docker.io/alwaldend/src:projects_infinitime_pinetime_mcuboot_app_dfu_1_15_0_zip_head
- Pair the watch in
Gadgetbridge - Install the firmware
17 - Kustomization
Kubernetes resources for Flux, Traefik, and cert-manager
This project contains Kubernetes Kustomization resources for Flux, Traefik,
and cert-manager. The resource set remains incomplete and receives maintenance
as needed.
Links
17.1 - OpenSpec
17.1.1 - Specifications
17.1.1.1 - Project dns
17.1.1.1.1 - project-dns Specification
Purpose
Record the retirement of this project’s landing DNS infrastructure while
preserving its repository documentation and builds.
Requirements
Requirement: Keep landing infrastructure retired
The project SHALL have no dedicated landing DNS declaration, Terraform root, or
operational source export. Its landing page SHALL be published by the main site
under /projects/kustomization/ instead of a dedicated hostname.
Scenario: Inspect the project after landing retirement
- WHEN the project tree is consumed
- THEN it contains no landing DNS declaration, Terraform DNS stage, or
landing build target, and the main site owns its landing page.
17.1.1.2 - Project kustomization
17.1.1.2.1 - Kustomization Specification
Purpose
Provide in-progress Kubernetes resource definitions for Flux, Traefik, and
cert-manager. This baseline records declared resources at revision
550d7e79b1f5fdbc2b6017b75178471d6914082f, observed on 2026-09-08. It does not
assert successful rendering, reconciliation, or a deployed cluster state.
Sources: project README,
Flux source,
Traefik release,
Traefik remote resources,
and cert-manager release.
Requirements
Requirement: Scoped Flux repository source
The Flux GitRepository declaration SHALL select the repository’s master
branch, refer to the flux-git-src credential secret, and include only infra
and projects/kustomization from the repository through its ignore rules.
Scenario: Inspect repository source scope
- WHEN the checked-in Flux GitRepository is inspected
- THEN its branch, secret reference, and inclusion paths SHALL match the
declared source scope.
Requirement: Traefik Gateway API configuration
The Traefik definitions SHALL declare an OCI chart source and HelmRelease that
enable the Kubernetes Gateway provider, disable the Kubernetes Ingress provider,
and configure HTTP redirection to HTTPS with a named TLS certificate secret.
Scenario: Inspect gateway configuration
- WHEN the Traefik HelmRelease values are inspected
- THEN they SHALL enable HTTP and HTTPS gateway listeners and reference
traefik-gateway-websecure-tls for HTTPS termination.
Requirement: cert-manager reconciliation configuration
The cert-manager definitions SHALL declare an OCI chart source and HelmRelease
with Gateway API support, CRD installation, Helm tests, and drift detection
enabled.
Scenario: Inspect certificate controller configuration
- WHEN the cert-manager HelmRelease is inspected
- THEN its values SHALL enable Gateway API support and CRDs, and its release
settings SHALL enable tests and drift detection.
18 - Leetcode downloader
LeetCode submission export and documentation tools
This project exports LeetCode submissions and generates documentation from
submission files using a CLI and Bazel rules. A Tampermonkey script provides
a browser-based download path; direct CLI downloads are currently blocked by
LeetCode bot protection.
Links
Features
- CLI and bzl code to generate submission docs
- Tampermonkey script to download submissions
- CLI to download submissions (Doesn’t work because of bot protection)
Usage
Generate submission from a submission file
bazel run //projects/leetcode_downloader -- \
--submissions-file "${PWD}/out/submissions.json" \
--root-dir "${PWD}" \
generate
Help
Usage of flags:
-base_url string
(default "https://leetcode.com")
-cookie string
-limit uint
(default 20)
-offset uint
-root-dir string
(default "${PWD}")
-submissions-file string
18.1.1 - al_leetcode_submissions
al_leetcode_submissions
load("@com_alwaldend_src//projects/leetcode_downloader/rules:al_leetcode_submissions.bzl", "al_leetcode_submissions")
al_leetcode_submissions(name, srcs, visibility, **kwargs)
Generate leetcode submission targets
PARAMETERS
| Name | Description | Default Value |
|---|
| name | generated md archive name | none |
| srcs | leetcode submission configs | none |
| visibility | visibility | None |
| kwargs | kwargs for template_files | none |
18.2 - Proto
Protobuf contracts
18.2.1 - contracts
Proto docs for contracts.proto
Java
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "name",
deps = [
"@com_alwaldend_src//projects/leetcode_downloader/api/contracts:contracts_java_library",
],
)
Golang
load("@rules_go//go:def.bzl", "go_library")
go_library(
name = "name",
deps = [
"@com_alwaldend_src//projects/leetcode_downloader/api/contracts:contracts",
],
)
Proto
syntax = "proto3";
option go_package = "git.alwaldend.com/alwaldend/src/projects/leetcode_downloader/api/contracts";
enum CliAction {
DOWNLOAD = 0;
GENERATE = 1;
UPDATE = 2;
}
message Config {
string base_url = 1;
string cookie = 2;
repeated string action_args = 4;
CliAction action = 5;
uint64 offset = 6;
uint64 limit = 7;
map<string, SubmissionConfig> submissions = 8;
string root_dir = 9;
map<string, string> headers = 11;
string submissions_file = 12;
bool write_code = 13;
}
message SubmissionConfig {
string dir = 1;
string extension = 2;
repeated string types = 3;
}
message Submission {
uint64 id = 1;
string status_display = 2;
string lang = 3;
uint64 question_id = 4;
string title_slug = 5;
string code = 6;
string title = 7;
string url = 8;
string lang_name = 9;
// string time = 10;
uint64 timestamp = 11;
uint64 status = 12;
string runtime = 13;
string is_pending = 14;
string memory = 15;
string compare_result = 16;
bool has_notes = 17;
uint64 flag_type = 18;
}
message SubmissonsResponse {
repeated Submission submissions_dump = 1;
bool has_next = 2;
string last_key = 3;
}
message SubmissonsStorage {
repeated Submission submissions = 1;
}
19 - Llama Responses bridge
Loopback Responses API function namespace compatibility for llama.cpp
This project adapts Responses API function namespaces for llama.cpp servers
that accept only flat function tools. It flattens function schemas, replayed
calls, and forced tool choices, then restores namespace/name identities in JSON
and streaming replies. The adapter performs no inference or tool execution.
Run
bazel_agent bazel run //projects/llama_responses_bridge -- --listen 127.0.0.1:8080 --upstream http://127.0.0.1:8081
Point the client’s Responses provider at http://127.0.0.1:8080/v1 and run
llama.cpp on 127.0.0.1:8081. Both endpoints are configurable, but the command
requires literal IPv4 loopback addresses. It proxies only POST /v1/responses,
GET /v1/models, and GET /health, without query strings. The bridge has no
authentication and is intended for a trusted local host.
Request bodies, JSON replies, and individual SSE events are bounded at 32 MiB.
Only function tools and function-only namespaces are supported; other tool types
are rejected explicitly. Mappings are request-local, and disconnects cancel the
upstream stream. Call arguments and user text are not rewritten.
Ownership and acceptance
cmd/responses_bridge owns flags, loopback validation, and the HTTP process.internal/responses owns protocol translation and fixed-upstream proxying.test/protocol owns command-level fixtures with a deterministic local backend
and an optional real Codex MCP call/result round trip.openspec owns maintained extraction work. Service units and host deployment
remain with their infrastructure consumer.
Run the existing acceptance suite:
bazel_agent bazel test //projects/llama_responses_bridge/test/protocol:protocol_test --test_output=all
See protocol acceptance for the optional Codex check.
The adapter was verified with Codex 0.166.0 and llama.cpp’s b11960/b12032 tool
schema limitation. These fixtures establish protocol behavior, not GPU loading,
model quality, or deployment readiness. Remove the compatibility layer when a
pinned upstream server passes the namespace round trip directly.
19.1 - Local Responses protocol acceptance
Run the command-level fixture without a GPU, model, credentials, or deployment:
bazel_agent bazel test //projects/llama_responses_bridge/test/protocol:protocol_test --test_output=all
The fixture starts the built bridge on an ephemeral loopback port and uses a
function-only inference backend. It checks duplicate local names in separate
namespaces, plain functions, JSON and SSE replies, replayed calls, forced tool
selection, and rejection of unsupported schemas. Bazel retains test.log as
the repeatable acceptance artifact.
The same target accepts --test_arg=-codex-binary=/absolute/path/to/codex.
Use the pinned Codex 0.166.0 executable in an isolated environment with no
system Codex requirements. The optional case starts a local MCP fixture,
asks Codex to use its tool, checks the model request contains the flattened
schema, returns a deterministic tool call, and verifies that Codex executes
the tool and submits its result before completing the follow-up response.
This tests the protocol and execution path, not model quality.
On a host with shared managed Codex requirements, build first, then run the
compiled test in an isolated network/mount namespace. For example, using the
host’s existing bwrap installation:
mkdir -p out/llama_responses_bridge/acceptance/tmp
bwrap --unshare-net --die-with-parent --ro-bind / / --dev-bind /dev /dev \
--proc /proc --tmpfs /etc/codex \
--bind "$PWD/out/llama_responses_bridge/acceptance" "$PWD/out/llama_responses_bridge/acceptance" \
--setenv TMPDIR "$PWD/out/llama_responses_bridge/acceptance/tmp" \
--setenv RUNFILES_MANIFEST_FILE "$PWD/bazel-bin/projects/llama_responses_bridge/test/protocol/protocol_test_/protocol_test.runfiles_manifest" \
"$PWD/bazel-bin/projects/llama_responses_bridge/test/protocol/protocol_test_/protocol_test" \
-bridge=_main/projects/llama_responses_bridge/cmd/responses_bridge/responses_bridge_/responses_bridge \
-codex-binary=/absolute/path/to/codex -test.v -test.timeout=60s
No namespace tool conversion is currently available in the checked llama.cpp
b11960 or b12032 releases. The bridge can be removed when a pinned upstream
release passes these acceptance cases directly.
20 - MCP Cordis
Workspace-local runtime packages behind a stable MCP server
mcp_cordis is a standalone stdio MCP server that mounts runtime JavaScript
packages through Cordis.
It is intentionally an MCP server, not a Codex plugin bundle.
Reusable definitions are ordinary ESM files in
projects/mcp_cordis/plugins, listed by projects/mcp_cordis/cordis.yaml.
Disposable definitions use the same layout under
out/<task>/mcp_cordis/runs/<run>/. Each run writes a bounded manifest with
explicit task, run, worker, information, budget, retention, lock, and cleanup
fields. AGENT_TASK_ID, AGENT_RUN_ID, and AGENT_WORKER_ID may provide
stable identities; the launcher otherwise creates process-scoped identities.
Every
package is addressed by both scope and name, so a scratch package never
silently shadows a reusable package.
Run
The repository’s .codex/config.toml registers mcp_cordis as a
project-scoped stdio server. Codex loads that file for a trusted workspace and
finds the active Git worktree before starting the server. Separate clones and
worktrees therefore use their own source, projects/mcp_cordis packages, and
task/run-namespaced scratch packages. Trusting the repository’s root checkout
also covers its linked worktrees; a glob trust entry is neither needed nor
supported. A new Codex session is needed after the MCP registration itself is
first added; package changes after that do not require another session.
The registration calls cmd/mcp_cordis/launch.sh. The launcher asks Bazel for
a launch script under the task’s ignored out directory, then executes it
after Bazel exits. This releases Bazel’s output-base lock before the
long-lived stdio server starts, so builds and tests can run normally while
Codex remains connected. The server reads cordis.yaml and reusable plugins
from the explicit active workspace; editing a package changes live behavior
without rebuilding the server runtime.
To build and run the server directly from the repository root:
bazel run //projects/mcp_cordis:mcp_cordis -- \
--workspace-root "$PWD" \
--task-id example-task \
--run-id example-run
The workspace root is mandatory unless BUILD_WORKSPACE_DIRECTORY is
present. The checked-in launcher resolves the current Git worktree explicitly
and supplies that path to the server.
The fixed cordis_* tools define, start, inspect, invoke, update, stop,
remove, and promote packages without reconnecting the MCP client. Package
handlers are called through cordis_invoke; this remains reliable even when
an MCP client caches its initial tool list.
cordis.yaml uses the standard Cordis Include entry-list format:
- id: hello
name: ./plugins/hello.mjs
The referenced file is a normal ESM Cordis plugin:
const plugin = {
description: "Provide a greeting.",
apply(ctx) {
ctx.tool(
{
name: "hello_world",
description: "Return a greeting.",
inputSchema: {
type: "object",
properties: { name: { type: "string" } },
additionalProperties: false,
},
},
({ name = "world" }) => ({ greeting: `Hello, ${name}!` }),
);
},
};
plugin.apply.description = plugin.description;
export default plugin;
Cordis normalizes an object plugin to its apply callback. Attaching the
optional package description to that callback exposes it through
cordis_list and cordis_inspect; tool descriptions remain part of each
ctx.tool() definition.
The server mounts the official Cordis Loader, Include, and HMR services.
cordis_define syntax-checks and atomically persists the ordinary module.
Creating or enabling an entry refreshes any cached module through Cordis HMR,
then uses the public Include refresh API and waits for activation. Updating an
already-running entry returns activation: "pending"; poll cordis_invoke or
cordis_list_tools until the new behavior is visible.
The reproducibly pinned HMR package carries a focused pnpm patch that
serializes module reloads and drains source changes arriving during an
in-flight reload, so the latest persisted source is not lost.
Syntax errors are rejected before the file changes. Evaluation and apply()
failures follow native Cordis HMR behavior; the wrapper does not add a second
activation transaction around them. It also does not inject source markers,
inspect Loader caches, correlate watcher events, or maintain its own source
rollback/version store. Reusable history is normal Git history. Manual edits
to watched plugin files are also picked up by Cordis HMR.
Runtime modules use normal Cordis semantics, including static imports,
top-level await, and asynchronous apply(ctx, config). Package code is
trusted: a never-settling module evaluation or activation can therefore stall
Cordis lifecycle work. The stdio launcher reserves its protocol stream and
redirects package stdout to stderr, keeping accidental console.log() calls
off the JSON-RPC wire.
The package context exposes ctx.workspaceRoot, ctx.resolveWorkspace(),
ctx.readText(), and structured ctx.exec() in addition to ctx.tool().
ctx.exec() returns code, signal, stdout, stderr, truncated, and
outputLimitExceeded; maxBytes is a combined stdout/stderr budget. By
default, exceeding that budget or producing invalid UTF-8 rejects with
EXEC_OUTPUT_LIMIT or EXEC_INVALID_UTF8. Packages that explicitly set
allowTruncatedOutput: true instead receive the valid retained prefix with
truncated set; outputLimitExceeded distinguishes the byte cap from UTF-8
loss. A Fiber-owned supervisor admits each launch atomically, and results
settle only after the direct child and every live member of its original Linux
process group have stopped. Limits, timeouts, and plugin disposal use the same
cleanup path. A process that deliberately creates a new session escapes that
group and is outside this trusted-package contract. ctx.exec() therefore
fails closed with EXEC_UNSUPPORTED_PLATFORM away from Linux. Package code
also has normal Node built-ins; this host is a reliability boundary, not a
security sandbox.
cordis_invoke.timeout_ms bounds how long the gateway waits for a result; it
does not cancel an already admitted JavaScript handler. The handler keeps its
Fiber lease until it finishes, so stop, remove, and shutdown wait for it.
Cordis HMR waits for a retired Fiber to finish draining before it activates
and publishes the replacement, so a live invocation can delay a reload. Any
ctx.exec() launched by a timed-out invocation is cancelled and its process
group is confirmed stopped before the timeout response settles.
Included packages
repo_context: bounded repository reads and searches.git_worktree: read-only branch, status, log, and comparison snapshots.network_probe: DNS, TCP/TLS, and HTTP diagnostics.
These were selected from aggregate recurring task categories in recent local
sessions. No transcript content, credentials, or private outputs are included.
Maintained change history
The completed runtime extensions change
preserves acceptance criteria, decisions, failed attempts and supporting
evidence. New work uses the project OpenSpec workspace
and a new change; the archived acceptance remains historical.
Dependency notices
The runtime directly uses @deepseek-ai/cordis, its official Loader, Include,
HMR, and Timer plugins, and the Model Context Protocol TypeScript SDK. Their
license texts are retained in the resolved package artifacts by the pinned
pnpm/Bazel dependency graph.
The Include plugin’s entry-list schema is patched to use js-yaml 5’s scalar
tag API. Its dependency override selects the same js-yaml release as the
runtime, so parsing, configuration writes, and reloads share the !!js dialect.
21 - Mermaid 3D
Themed spatial views of Mermaid diagrams
This project owns the three-dimensional Mermaid renderer, scene layout,
interaction, packaging, and browser verification. Existing diagram definitions
and their themes stay with their consumers; Mermaid dependency pins remain in
the repository’s tools pnpm workspace.
Build all five graph examples and open any generated HTML file in a WebGL 2 browser:
bazel build //projects/mermaid_3d/samples:html
Outputs are in bazel-bin/projects/mermaid_3d/samples/. Each .3d.html embeds
Three.js, camera controls, the scene, and Liberation Mono. Viewing requires no
server or network requests. Drag to orbit, right-drag to pan, and scroll to zoom.
The controls select light or dark appearance, reset the camera, show a front
view, and inspect nodes, groups, and connections. Labels face the camera.
Selecting a connection highlights it and its endpoints; node selection includes
direct connections, and group selection includes nested members.
Elements remain independently selectable when different kinds share an ID.
The default readable view keeps text at least 12 CSS pixels at reset scale;
large scenes scroll within their panel. Fit diagram shows the complete
overview, and Reset view restores readable framing. On touch screens, swipe
to scroll the readable view; switch to the overview for orbit and pinch controls.
The overview panel follows the scene’s proportions up to its desktop or phone
height limit, keeping inspection controls near wide diagrams.
Camera clipping follows the scene’s depth as the view changes, including large
flowcharts whose initial camera distance exceeds that of the examples. Drawing
buffers fit the device’s WebGL limits, reducing pixel density for wide scenes
while preserving their CSS dimensions and scrolling.
The theme gallery owns the six
Mermaid definitions. The sample targets consume the five graph definitions directly and use
the shared //internal/assets:mermaid_theme bundle and its pinned diagram font.
The gallery links static SVGs and interactive 3D views.
Rendering


Explore the flowchart in 3D.
Native 2D SVG.
All views are generated from one Mermaid source.
The flowchart follows a successful CLI run.
The mermaid_3d CLI runs in Node and launches a separate headless Chrome process
through Puppeteer. Chrome loads the font and Mermaid; the nested Mermaid group
shows the mermaid.render() call. Our layout hook projects typed graph data and
normalizes label text before canvas measurement. The CLI receives the graph and
font metrics, closes Chrome, then sizes and places nodes/groups, routes connections, and packages
the outputs. The Bazel rule invokes this CLI with declared inputs. The CLI writes
self-contained HTML and optionally exports the scene and metadata as JSON.
mermaid_3d in defs.bzl takes a Mermaid src and one theme target providing
MermaidThemeInfo, with out for HTML and model for inspection JSON. The
bundle supplies configuration, JSON light/dark palettes, font, and license.
The CLI uses headless Chrome to parse and normalize graph data and measure text.
Chrome supplies the DOM for Mermaid’s render hook and canvas font measurements.
It computes layout and routes, then embeds the model, modules, appearances, font,
and license in HTML. The offline browser viewer creates the Three.js meshes and
handles interaction.
The default output is HTML; the named JSON output is available for diagnostics.
The optional view attribute (CLI --view) selects front-left or front-right;
the default is front-right. Reset view restores the selected initial perspective.
Static snapshots
mermaid_3d_snapshot renders an existing HTML target as a PNG or WebP image.
It uses the viewer’s scene and framing, includes geometry and labels, and
encodes only the canvas. Documentation can embed the image and link to the
interactive HTML. No controls, server, or remote assets are required.
load("//projects/mermaid_3d:defs.bzl", "mermaid_3d_snapshot")
mermaid_3d_snapshot(
name = "diagram_snapshot",
src = ":diagram_3d",
out = "diagram.3d.png",
color_scheme = "light",
camera = "isometric",
width = 1600,
height = 900,
)
The isometric option preserves the diagram’s configured 3D perspective.
Choose camera = "front" for a front projection. PNG is lossless; WebP uses
the browser’s highest quality setting. Defaults are 1280 by 960 pixels. Each
dimension must be 128–8192 pixels, with at most 16,777,216 pixels in total.
Choose an aspect ratio suited to the diagram; fitting the complete scene can
make text small in a narrow image. Build all five light/dark sample pairs with:
bazel build //projects/mermaid_3d/samples:snapshots
The site recognizes matching .dark.png and .dark.webp siblings using the
same theme menu as SVG diagrams. The architecture image above is a snapshot.
Scene construction
Mermaid owns parsing. A public registerLayoutLoaders extension receives nodes,
groups, and edges through mermaid.render for flowcharts, state, class,
entity-relationship, and mindmap diagrams. The temporary SVG lifecycle completes
without painting graph geometry; the spatial adapter builds a Three.js scene.
The browser projects explicit fields into typed graph data before measurement.
Sequence diagrams are unsupported because their rendering path bypasses this
extension; the command rejects them before producing a viewer.
The parsing browser normalizes display text before measurement, including Mermaid
entity codes and generic class headings. Invisible graph links constrain placement
without becoming visible or selectable connections. Groups use their declared
direction or inherit the enclosing direction.
One measured text layout supplies card dimensions and label drawing, including
bold headings and compartments. Decision nodes use diamond prisms with clear front
faces sized to contain multiline labels; rear group strokes recede using the
existing palette as the camera moves.
Group titles retain line breaks and contribute to their frame dimensions;
camera framing includes the labels’ visible extents.
Graph layout condenses cycles before ranking, places group members recursively,
and reserves depth corridors for spatial edge routes. Connections leave side
ports and use smooth curves when clear, adding rounded detours around obstructing
nodes. Curvature adapts to available clearance; arrowheads follow the path tangent,
and dash spacing remains continuous through bends.
Decision-node ports follow the diamond face, including multiple connections on a side.
Self-loops use separate ports on the same side and remain outside their node face.
Connections use a tube renderer, with dash sections merged into one mesh per path. Each embedded JavaScript module has one import-map entry,
avoiding duplicate copies of the Three.js core.
Their default projection also clears unrelated node faces. Nodes are solid meshes;
groups are volume outlines; paths and markers have thickness.
Relationship cardinalities remain explicit labels anchored near their endpoints.
Edge captions and group titles use background plates with themed borders.
Class and entity cards distinguish headings and compartments. Annotation labels
avoid projected node faces and other labels using bounded displacement with
leader lines, recomputed when the camera changes.
This is an initial renderer for the maintained examples, not full Mermaid syntax
or shape parity. It preserves the shared font and palette, not arbitrary SVG CSS
or per-node styles. Arbitrary camera angles or unusually dense
diagrams can exceed the label-placement search area; selecting an element and
changing the camera remains useful. Optimal routing is not guaranteed. Mermaid
graph-data changes require adapter verification on upgrades.
TypeScript
All renderer, snapshot, and project E2E sources use ordinary .ts files.
Bazel checks them with strict and noEmitOnError, then runs or embeds the
emitted .js ES modules. One project-owned package.json supplies module
metadata. Model declarations connect the separate Node and browser compiler
contexts; Three.js declarations are compiler inputs and are not embedded
in the generated HTML. Generated JavaScript stays in Bazel outputs.
Source layout
The command builds the model and packages a standalone viewer. Implementation
modules stay under internal/; the browser controller owns camera and UI state,
with scene construction and label placement handled separately.
| Path | Responsibility |
|---|
cmd/render/main.ts | Parse inputs, measure themed text, and embed the viewer’s modules and assets |
internal/model.ts, routing.ts | Adapt Mermaid data, place elements, and route connections |
internal/text.ts | Shared text layout for build-time measurement and browser drawing |
internal/viewer/main.ts | Camera, controls, selection, and rendering updates |
internal/viewer/scene.ts, labels.ts | Three.js objects, label drawing, placement, and inspection |
internal/viewer/document.ts, viewer.css | Offline HTML document and viewer styles |
test/browser/ | Browser verification and behavior fixtures |
cmd/snapshot owns offline image export; internal/snapshot.bzl exposes its
build rule, and test/snapshot checks the encoded images end to end.
Verification
bazel test //projects/mermaid_3d/test/browser:browser_test //projects/mermaid_3d/test/snapshot:snapshot_test
The browser test opens every built view with remote requests blocked. It checks
source labels and counts, node volumes, group containment, routes against unrelated
nodes, theme/font loading, selection, camera orbit/reset, mobile controls,
readable label sizes, projected label separation, scene framing, and native touch
scrolling. It emits full-scene, light/dark, front, phone, and overview screenshots
and verification.json with the checked HTML hashes in the test’s test.outputs
directory. Five graph fixtures cover shared identifiers, self-loop projection,
long multiline group titles, entity decoding, generic class text, diamond
containment, invisible links, local subgraph direction, and diamond connection ports.
The architecture view also verifies the CLI to the left and in front of Chrome.
The eleven maintained views enforce budgets of 4 MiB per HTML file and 150 draw
calls per scene. A separate fifty-node flowchart checks visible canvas pixels
after opening, orbiting, resetting, changing view and appearance, and resizing.
At device pixel ratio 2 it verifies actual WebGL buffer dimensions, GPU limits,
visible raster content for every node, and native density in the small overview.
Images and drawing-buffer measurements are retained with the artifacts.
22 - MLflow Vast.ai backend
Planned MLflow Projects execution backend for Vast.ai rentals
The Python plugin connects MLflow Projects to a Vast.ai job server using gRPC.
The Go job server assigns jobs to existing Vast.ai rentals. A worker on each
rental runs jobs and records their outcomes.
The plugin architecture shows how the submitter,
coordinator, worker, and MLflow exchange requests and data.
Go CLI
bazel run //projects/mlflow_vastai_backend/cmd/mlflow-vastai -- worker serve
The CLI machine parses arguments and starts the application child with a typed
command. The application delegates worker commands to its worker child.
worker serve starts the worker’s listener machine, and the listener uses
the SQLite-backed job machine. server serve starts the job coordinator.
Export the composed application graph as DOT or build the themed SVG on Linux.
bazel run //projects/mlflow_vastai_backend/cmd/mlflow-vastai -- state-machine graph
bazel build //projects/mlflow_vastai_backend/cmd/mlflow-vastai:state_machine_svg
The SVG is at bazel-bin/projects/mlflow_vastai_backend/cmd/mlflow-vastai/state-machine.svg.
Bazel builds Graphviz from pinned source. The SVG embeds the shared diagram
font and uses the common theme’s light and dark palettes. The
state machine page embeds the generated graph.
Job server
bazel run //projects/mlflow_vastai_backend/cmd/mlflow-vastai -- server serve \
--state-dir /path/to/server-state --workers training,12345 \
--tracking-uri https://mlflow.example.com --ssh-user root
Inject VAST_API_KEY for read-only rental discovery. Set MLFLOW_TRACKING_TOKEN
for bearer authentication, or use MLFLOW_TRACKING_TOKEN_FILE to read a
rotating bearer token on every tracking request. Use a
tracking endpoint reachable from both the server and the rentals. The server
accepts workloads using that configured HTTP or HTTPS tracking endpoint.
--workers lists allowed instance IDs and exact labels in preference order.
If the plugin specifies a worker, its selector must match an entry. A label
must identify a single existing rental. Install mlflow-vastai on the
rental’s SSH account PATH and register its SSH host key with the coordinator’s
account. The SSH client uses the rental worker’s default state directory.
The gRPC listener binds to 127.0.0.1:50051 by default and accepts only
loopback addresses. Use the local endpoint from a trusted environment, or
front it with an authenticated transport for remote access.
The server saves the selected rental before submitting a workload. It retries
ambiguous submissions on that rental with the original run ID, observes jobs
after clients disconnect, and publishes confirmed terminal results to MLflow.
Rental worker
Run worker serve as the rental’s SSH user with mlflow on PATH and the
project’s training runtime installed. The worker uses that MLflow CLI and its
tracking credentials to download the project snapshot. It runs the prepared
entry point with MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_ID, and
MLFLOW_RUN_ID set.
Use worker --state-dir /path/to/state serve to set the state directory.
The default is $XDG_STATE_HOME/mlflow-vastai or
$HOME/.local/state/mlflow-vastai. An existing directory must be private to
its owner. The listener keeps worker.sock, jobs.sqlite3, and per-job
directories under that path. Workload output goes to stdout.log and
stderr.log. Artifact download and workload errors are logged by the listener.
worker submit, worker status, and worker cancel use the same state
directory. They read one binary protobuf from stdin and return a binary Job
on stdout. Submission takes SubmitJobRequest. Status and cancellation take
JobReference.
The listener reserves the MLflow run ID in SQLite and immediately starts
preparing the workload. Status is RUNNING from acceptance through execution.
Cancellation stops the local workload, and the listener records the confirmed
outcome. Graceful shutdown stops active workloads and records their results.
After a crash, a new listener reports unfinished jobs as unknown and preserves
the original reservations.
Run a project
Give the plugin a JSON backend configuration with server set to the gRPC
address. Set worker to request a configured worker selector. Use TLS through
an authenticated gateway or connect directly to a trusted local listener as
shown here.
{
"server": "127.0.0.1:50051",
"worker": "training",
"insecure": true
}
export MLFLOW_TRACKING_URI=https://mlflow.example.com
bazel run //projects/mlflow_vastai_backend:mlflow -- run /path/to/project \
--backend vastai --backend-config /path/to/backend.json --env-manager local
Use an HTTP or HTTPS tracking endpoint reachable from the submitting machine,
coordinator, and rental. The rental also needs access to the run’s artifact
store.
The adapter uploads a compressed project snapshot to the MLflow run at
vastai-source/project.tar.gz before submitting the job. The request carries
the artifact path, rendered entry point, and MLflow tracking context. The worker
needs read access to the run artifacts and a preconfigured training runtime.
The snapshot uses the current contents of Git-tracked files under the project
directory. Set project_files to a JSON list of additional project-relative
regular files. For a project outside Git, supply the full file list this way.
If the client reports an unconfirmed submission, use the reported MLflow run
ID to locate the existing job before submitting again.
This version does not stage MLproject path parameters or provision Docker,
conda, or virtualenv environments.
Verify
bazel test //projects/mlflow_vastai_backend/test/e2e:plugin_test
bazel test //projects/mlflow_vastai_backend/test/e2e:worker_test
bazel test //projects/mlflow_vastai_backend/test/e2e:server_test
bazel build //projects/mlflow_vastai_backend/api/jobpb:jobpb
The plugin test uses a local gRPC fixture. The worker test uses the real CLI,
Unix gRPC socket, SQLite state, and an MLflow artifact store. Refresh the
project’s Python lock with
bazel run //projects/mlflow_vastai_backend:uv_lock.update.
References
22.1 - Application state machines
Command dispatch, listener lifecycle, and job transitions in the MLflow Vast.ai backend
CLI dispatch

See the plugin architecture for the service boundaries
and protocols.
The CLI machine enters cli-parsing and uses Cobra to parse the arguments.
cli-dispatch calls the selected application method. The application calls
the worker through its named methods. Each component adds its own states and
child calls to the graph. Dashed arrows show those calls.
server serve runs the coordinator and its job machine.worker serve runs the worker’s listener child machine. Its states open the listener
in worker-starting, serve RPCs in worker-serving, and release resources
in worker-stopping.state-machine graph prints the machine definitions and their calls as one DOT graph.
worker submit, worker status, and worker cancel enter forward-rpc
and send protobuf requests over the worker’s Unix socket. Bazel regenerates
the diagram from the CLI when it builds this page.
Coordinator jobs
The coordinator reserves an assignment before contacting the worker. Its
job machine advances from reserved to active or to a recorded result. The
server reconciles unresolved assignments and publishes confirmed terminal
results to MLflow while their tracking runs are active.
Worker jobs
The listener delegates submission, status, and cancellation to the job runner.
The runner reserves the run ID in SQLite and starts the workload machine as
soon as that transaction commits. The workload machine stages the project and
runs the prepared command. The job runner signals active workloads and records
their outcomes. It retries failed writes using the observed result.
The listener closes the job runner before closing SQLite. The runner stops
active workloads and gives pending writes a bounded time to finish. On
startup, the job runner marks interrupted jobs as unknown through the same
result transition and preserves their run IDs.
22.2 - Plugin architecture
Submission, execution, and result tracking across MLflow and Vast.ai


The MLflow run ID identifies the workload across the plugin, coordinator, and
worker. The coordinator records its rental assignment before dispatch. The
worker records the outcome before reporting it.
The worker receives the project snapshot from MLflow’s artifact store and runs
the entry point on the rental. The workload logs metrics and artifacts to the
run. The coordinator publishes confirmed terminal status to MLflow and retries
failed updates after the submitting client disconnects.
Terraform provisions and releases rentals. The coordinator discovers existing
rentals through the Vast.ai API.
See the application state machines for process lifecycles
and job transitions.
23 - MLOps 2026
MLOps course


An MLOps course project with a factory-based FastAPI application named
recommender, served by Uvicorn. App and router instances are created inside
factories. RecommenderApplication owns the app and receives its service in the constructor;
RecommendationRouter owns the versioned routes and service reference.
The injected RecommendationService implements __aenter__ and __aexit__
for model loading and deterministic shutdown. Its idempotent close() also
runs from __del__ as a fallback. Application, router and service state is
private; app and router access use explicit read-only properties. Imports
do not start services or create shared application instances. Response contracts
are exported from internal/models.
Implementation lives under internal/recommender/, with other future apps owning
sibling packages under internal/ and separate cmd/ entry points.
Run recommender
bazel run //projects/mlops_2026/cmd/recommender -- --host 127.0.0.1 --port 8000
The defaults are 127.0.0.1:8000. GET /health returns {"status": "ok"}.
FastAPI serves the generated schema at /openapi.json, Swagger UI at /docs,
and ReDoc at /redoc; the documentation UIs use FastAPI’s default external
assets. GET /api/v1/recommend?track_name=Time&n=5 returns requested_track
and song recommendations containing track_name, artists, and album_name.
track_name is required; n defaults to 5 and must be between 1 and 20.
An unknown track returns an empty list. Invalid queries return HTTP 422.
The pinned upstream data.csv and dataset.csv are included in the executable
runfiles and resolved independently of the working directory. Startup checks
that both exist. Each app loads its packaged model once during startup using
the upstream load_model function, then releases it on shutdown. Health checks
do not invoke recommendation computation. Source and integrity are
owned by third_party/com_github_yandex_practicum_mlops_freetrack/.
Build the course model
bazel build //projects/mlops_2026:model
The sandboxed target runs the upstream train_and_save_model.py unchanged,
stages its CSV inputs in an action directory, and produces
bazel-bin/projects/mlops_2026/model.pkl. It exposes a declared build artifact
consumed by the recommender executable. The upstream script is
also buildable as
//third_party/com_github_yandex_practicum_mlops_freetrack:train_and_save_model;
running that script directly requires a working directory with both CSVs and
writes model.pkl there. Prefer the model build target for isolated execution.
The full training data joins to 6,788 unique tracks. Its dense similarity matrix
uses about 0.34 GiB; the serialized artifact is about 359 MiB. The model target and isolated model
verification are marked manual, but building or testing the recommender now
requires this artifact and can trigger training when it is not cached. Shared Python dependencies are declared and locked under tools/py/.
Verify
bazel test //projects/mlops_2026/test/e2e:recommender_test
bazel test //projects/mlops_2026/test/e2e:model_test
These checks exercise real HTTP, factory isolation, startup conflict handling,
shutdown, service context exit, repeated and deletion cleanup, course runfiles
and checksums, and a recommendation from the built
model. Repeatable JSON artifacts are saved in each test’s undeclared outputs
under bazel-testlogs/projects/mlops_2026/test/e2e/.
The recommender has no deployment or release target.
GitLab
The GitLab Terraform root configures the provider and
Vault-backed state for the course instance. Its runbook includes the token
setup and plan commands.
Code-review lesson
The taxi-fare exercise has a Bazel training command,
dependency-backed CSV, saved model and metrics, and a reproducibility test:
bazel run //projects/mlops_2026/code_review:train -- --limit 99
bazel test //projects/mlops_2026/code_review/tests:training_test
Links
23.1 - MLOps GitLab Terraform
This Terraform root targets the course GitLab API at
mlops-rc.gitlab.yandexcloud.net. It starts with the provider and Vault-backed
HTTP state configured.
The account identified by the Vault token gets two public SSH keys. The
Vault simeonwarrenbot key uses GitLab’s default authentication and signing
scope. Terraform reads metadata.sshpubkey directly from the
Vault entity using the
project AppRole’s exact-path read grant.
The Forgejo instance key uses signing only. Forgejo setup publishes it
to the public-only KV record beside its private key record. The GitLab
AppRole can read the public record. Terraform enrolls the key through the
GitLab API at apply time.
Terraform tracks enrollment, and GitLab owns subsequent removal or drift
reconciliation for that signing-only key.
Once a Vault administrator has applied the
dedicated AppRole and read grant,
run this from the repository root using a Vault identity authorized to bootstrap
the role. Paste a GitLab token with the api scope and permissions for the
resources Terraform will manage.
(
set +x
unset mlops_gitlab_token
IFS= read -r -s -p 'MLOps GitLab API token: ' mlops_gitlab_token || exit 1
printf '\n' >&2
[ -n "$mlops_gitlab_token" ] || exit 1
printf '%s' "$mlops_gitlab_token" |
bazel run //projects/mlops_2026/tf/gitlab:vault.kv_put -- \
alwaldend.com/vault1/approles/src_projects_mlops_2026_gitlab/gitlab gitlab_token=-
)
The credential is stored as a single-field KV entry. Repeating the command
replaces that entry with the new token. Terraform receives it as GITLAB_TOKEN.
bazel run //projects/mlops_2026/tf/gitlab:tf.plan
Module 3 repository
The module_3 project starts empty in the token account’s namespace. Push
master as the first branch. Internal visibility lets authenticated non-external users
clone the project. Terraform grants direct Reporter membership to active
Maintainers and Owners of mlops-yandex-practicum. Each plan refreshes the
group roles. Review any resulting membership additions or removals before apply.
The master branch protection permits Maintainers and Owners to push and
merge, with force pushes disabled. Adopt any protection GitLab creates on the
first push through a Terraform import before applying the rule.
GitLab looks for projects/mlops_2026/module_3/.gitlab-ci.yaml relative to the
root of the repository. The course branch must include that file to run the
custom pipeline.
23.2 - MLOps GitLab Vault AppRole
This Terraform root owns the Vault identity for the
MLOps GitLab Terraform project.
It uses the shared Vault admin configuration in //infra/vault:al.
It requires the shared secrets mount, AppRole auth backend, and
global_admins group. A Vault administrator can review it with:
bazel run //projects/mlops_2026/approle:tf.plan
Apply the reviewed AppRole configuration before storing the GitLab credential.
Forgejo setup must publish the sibling commit_signing_public record before
applying this root’s read grant. The course AppRole can read that exact
public-only entry. During cutover, the plan also proposes removing the
superseded MLOps-owned public entry. Review and authorize that removal as part
of the cutover after Forgejo’s public record is available.
23.3 - OpenSpec
23.3.1 - Specifications
23.3.1.1 - Course data
23.3.1.1.1 - course-data Specification
Purpose
Make the two upstream course datasets available to the MLOps application at
runtime with reproducible source identity and no checkout-path dependency.
Requirements
Requirement: Package pinned upstream course data
The application runtime bundle SHALL include data.csv and dataset.csv from
an immutable, integrity-verified revision of the user-requested
Yandex-Practicum/mlops-freetrack repository. Both files SHALL be available
through application runfiles without network downloads or dependence on the
repository working directory. Their bytes SHALL match the pinned upstream files.
Scenario: Launch outside the repository working directory
- WHEN the Bazel-built application is launched from a different directory
- THEN both CSV files resolve through its runfiles and can be opened
- AND their checksums match the pinned upstream source
Scenario: Check health with packaged course data
- WHEN the server starts with both course CSV files in its runtime bundle
- THEN GET /health retains its agreed response without parsing the datasets
or invoking recommendation computation
Requirement: Build the course model artifact
The repository SHALL expose a runnable upstream training target and a Bazel
build target whose declared output is model.pkl. Training SHALL use the pinned
course CSV files and resolved upstream Python dependencies without network
access or writing into source directories. The artifact SHALL be usable by a
future model consumer; the recommendation server SHALL load it through the upstream loader.
Scenario: Build the trained model
- WHEN the model build target is selected
- THEN it runs the pinned upstream training code against the pinned datasets
and produces a nonempty model.pkl in the Bazel output tree
- AND a verification consumer loads it and obtains a structurally valid
recommendation from a track present in the model
23.3.1.2 - Course placeholder
23.3.1.2.1 - course-placeholder Specification
Purpose
Describe current MLOps course documentation and supported local commands.
Requirements
Requirement: Publish truthful course placeholder documentation
The project SHALL provide a README identifying it as an MLOps course and linking
the user-supplied course page. After implementation it SHALL describe the runnable
health service and its supported endpoints and startup command, rather than
claiming that no code exists. Its documentation SHALL remain included through
repository documentation targets. The local application SHALL NOT require a
release deployment target.
Scenario: Inspect the course project
- WHEN a reader opens the project README after implementation
- THEN its description and external link identify the course
- AND it documents the health service, OpenAPI endpoints, and local startup
Scenario: Build project documentation
- WHEN repository consumers select the project documentation
- THEN its README and baseline specification are included
- AND release aggregation does not require an absent course release target
23.3.1.3 - Health api
23.3.1.3.1 - health-api Specification
Purpose
Provide a runnable HTTP foundation for the MLOps course with a health check,
an inspectable API description, and independent application instances.
Requirements
Requirement: Provide an operational health endpoint
The service SHALL respond to GET /health with HTTP 200 and the JSON object
{“status”: “ok”}. The response SHALL indicate that the HTTP application is
running without invoking recommendation computation or external services.
Scenario: Check a running application
- WHEN a client sends GET /health to a running service
- THEN it receives HTTP 200 with application/json content and {“status”: “ok”}
Requirement: Publish the generated API description and documentation
The service SHALL provide a valid OpenAPI document at GET /openapi.json,
including the health endpoint and its successful response contract. It SHALL
provide the default documentation pages at /docs and /redoc, configured to use
that schema URL.
Scenario: Inspect the API contract
- WHEN a client requests GET /openapi.json
- THEN it receives HTTP 200 with a valid OpenAPI JSON document describing
GET /health and its successful JSON response
Scenario: Open API documentation
- WHEN a client requests GET /docs or GET /redoc
- THEN it receives HTTP 200 with an HTML documentation page referring to
/openapi.json
Requirement: Preserve a versioned application API boundary
Future application endpoints SHALL use /api/v1 as their initial routing prefix.
Recommendations SHALL be exposed under that prefix; health and default API
documentation SHALL retain their agreed root paths.
Scenario: Request an unimplemented application endpoint
- WHEN a client requests GET /api/v1/predict
- THEN the service responds with HTTP 404 rather than exposing prediction
or placeholder business behavior
Requirement: Keep application instances independent
Constructing an application SHALL create fresh application and routing state.
Importing application modules SHALL NOT start a server, create shared mutable
application instances, or allocate external service resources. Changes to one
application’s routing SHALL NOT affect another application’s routing.
Scenario: Construct multiple applications
- WHEN two applications are constructed in one process and routing is
subsequently added to one of them
- THEN the other application’s routes remain unchanged
Requirement: Provide a configurable local server entry point
The service SHALL be runnable through a repository Bazel target with configurable
host and port. It SHALL bind to 127.0.0.1:8000 by default, accept an explicitly
selected loopback address and available port, and shut down cleanly on termination.
Scenario: Use an explicitly selected port
- WHEN the server target starts with a loopback host and an available port
- THEN the health and OpenAPI endpoints are served on that address
- AND terminating the server releases its resources and listening socket
Requirement: Serve model recommendations
GET /api/v1/recommend SHALL accept a required track_name query and an integer n
query defaulting to 5, constrained to 1 through 20. It SHALL return a
RecommenderRecommendationResponse with requested_track and recommendations of
RecommenderSong (track_name, artists, album_name). It SHALL use the upstream
load_model function to load the declared model.pkl during application lifespan,
with per-application state and no global model object.
Scenario: Recommend a known track
- WHEN a client requests a track in the trained model with n=3
- THEN it receives HTTP 200 and three typed song recommendations
- AND requested_track matches the query
Scenario: Reject an invalid recommendation count
- WHEN n is 0, 21, or nonnumeric, or track_name is absent
- THEN the response is HTTP 422
Scenario: Request an unknown track
- WHEN track_name does not exist in the model
- THEN requested_track is preserved and recommendations is empty
23.4 - Predicting taxi fares
Train a gradient boosting regressor on the pinned upstream Uber CSV and save
model.pkl with metrics.json. This maintained adaptation applies the lesson’s
review suggestions. The full dataset is fetched through Bazel; no CSV is checked in.
Run
From the repository root, with the repository Bazel setup available:
bazel run //projects/mlops_2026/code_review:train
Outputs default to out/code_review/ in this checkout. Bazel supplies the Python
runtime and dependencies from tools/py/uv.lock; a separate virtual environment
and the upstream’s old requirements file are not needed.
For a quick run using the first 99 data rows (equivalent to the former 100-line CSV):
bazel run //projects/mlops_2026/code_review:train -- --limit 99 --output-dir out/code_review_sample
The CLI accepts --dataset, --output-dir, --random-state (default 42),
--test-size (default 0.2), and optional --limit. A supplied dataset is a local
CSV path with the upstream schema: unnamed index, key, fare_amount,
pickup_datetime, pickup/dropoff longitude and latitude, and passenger_count.
Use an absolute path for a custom dataset. Relative output directories are
resolved against the checkout when invoked with bazel run.
Build artifacts
bazel build //projects/mlops_2026/code_review:model
This sandboxed, network-free action trains on the full upstream CSV and declares:
bazel-bin/projects/mlops_2026/code_review/model/model.pklbazel-bin/projects/mlops_2026/code_review/model/metrics.json
The target is marked manual because full-data training takes longer than the
sample test. Data fetching occurs through the existing integrity-pinned archive
before the action. The metric artifact records R², dataset path, split fraction
and seed, estimator parameters, optional row limit, and loaded/retained row counts.
The pickle contains the fitted scikit-learn estimator and expects the numeric
feature columns produced by src/features.py and src/data.py.
Verify
bazel test //projects/mlops_2026/code_review/tests:training_test
The standard-library test invokes the real CLI twice from an unrelated working
directory on the first 99 upstream records. It reloads each model, checks finite
predictions and R², validates metadata, and checks reproducibility. The test
retains verification.json in Bazel’s undeclared test outputs.
Data handling
Training removes rows missing required values and rows whose pickup or dropoff
coordinate pair is (0, 0). It extracts UTC hour and day of week, removes the
original timestamp, and excludes key, the CSV index, and fare_amount from
features. The fare remains the target. Both the split and estimator receive the
same seed. This exercise does not implement comprehensive anomaly validation
or hyperparameter search; its R² is a holdout score, not a quality guarantee.
Source
Adapted from lesson-08-code-review in the existing pinned
Yandex Practicum MLOps course.
The archive revision and integrity are owned by
third_party/com_github_yandex_practicum_mlops_course/include.MODULE.bazel.
The upstream MIT notice is retained in
the change record.
24 - Nexus security plugin
Security plugin for Sonatype Nexus 3
This plugin allows you to perform a check every time an artifact is requested from a repository
Links
Features
- A request handler that checks all requests to repositories
- Capability controlling the request handler
- A task that periodically updates the capability using a remote source
- Sonatype Nexus 3 plugin
- Java
Flow

24.1 - Model
Attributes of some classes
org.sonatype.nexus.repository.view.Response
etag: c849a44121f823c806f604d6568d9e89 (class java.lang.String)
last_modified: 2021-10-22T15:57:10.000Z (class org.joda.time.DateTime)
hashCodesMap: (class java.util.HashMap)
org.sonatype.nexus.common.hash.HashAlgorithm@7ce01bd8: bcbb583a5a4b4767de8ac020dea3d54011fee961
org.sonatype.nexus.common.hash.HashAlgorithm@5a3efc26: deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d
org.sonatype.nexus.common.hash.HashAlgorithm@5b0c0740: c849a44121f823c806f604d6568d9e89
org.sonatype.nexus.repository.storage.Asset:
metadata: (AttachedEntityMetadata)
schema: assetPath
document:
"#74:0": >-
bucket:#57:1,format:pypi,last_updated:Fri Jul 01 12:46:21 UTC 2022,attributes:[5],component:#65:0,
name:packages/pip/21.3.1/pip-21.3.1-py3-none-any.whl,size:1723581,content_type:application/zip,created_by:anonymous,
created_by_ip:80.78.253.49,blob_ref:default@E1F281C2-0A159DAD-4208CEFD-524F990B-0B4DDE11:739a4ecb-73fc-4422-a7d7-c93c8ad069c6,
last_downloaded:Fri Jul 01 04:44:03 UTC 2022,blob_created:Wed Jun 29 07:01:34 UTC 2022,blob_updated:Wed Jun 29 07:01:34 UTC 2022
name: packages/pip/21.3.1/pip-21.3.1-py3-none-any.whl
org.sonatype.nexus.repository.cache.CacheInfo:
lastVerified: 2022-07-01T12:46:21.457Z
cacheToken: 'null'
org.sonatype.nexus.repository.view.Request
org.apache.shiro.subject.support.DefaultSubjectContext.SESSION_CREATION_ENABLED: false (class java.lang.Boolean)
Key[type=org.sonatype.nexus.security.SecurityFilter, annotation=[none]].FILTERED: true (class java.lang.Boolean)
authcAntiCsrf.FILTERED: true (class java.lang.Boolean)
nx-authc.FILTERED: true (class java.lang.Boolean)
org.apache.shiro.web.servlet.ShiroHttpServletRequest_SESSION_ID_URL_REWRITING_ENABLED: false (class java.lang.Boolean)
javax.servlet.include.servlet_path: /repository/pypi/packages/pip/21.3.1/pip-21.3.1-py3-none-any.whl (class java.lang.String)
nexus.user.principal: admin (class java.lang.String)
nx-anonymous.FILTERED: true (class java.lang.Boolean)
nexus.user.id: admin (class java.lang.String)
nx-apikey-authc.FILTERED: true (class java.lang.Boolean)
org.sonatype.nexus.repository.view.Context
security.authorized: true (class java.lang.Boolean)
nexus.analytics.format_request_rates.marked: true (class java.lang.Boolean)
com.sonatype.nexus.repository.pypi.AssetKind: PACKAGE (class com.sonatype.nexus.repository.pypi.AssetKind)
local.attribute.org.sonatype.nexus.repository.view.handlers.HandlerContributor.extended: true (class java.lang.Boolean)
org.sonatype.nexus.repository.view.matchers.token.TokenMatcher$State: >-
org.sonatype.nexus.repository.view.matchers.token.TokenMatcher$1@19f23c0b ((class org.sonatype.nexus.repository.view.matchers.token.TokenMatcher$1))
org.sonatype.nexus.repository.Repository
proxy: (class java.util.HashMap)
contentMaxAge: 0.0
remoteUrl: https://pypi.org
metadataMaxAge: 0.0
negativeCache: (class java.util.HashMap)
timeToLive: 0.0
enabled: false
storage: (class java.util.HashMap)
strictContentTypeValidation: false
blobStoreName: default
httpclient: (class java.util.HashMap)
blocked: false
connection:
useTrustStore: true
autoBlock: false
org.sonatype.nexus.repository.storage.Asset
checksum: (class org.sonatype.nexus.common.collect.DetachingMap)
sha1: bcbb583a5a4b4767de8ac020dea3d54011fee961
sha256: deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d
md5: c849a44121f823c806f604d6568d9e89
cache: (class org.sonatype.nexus.common.collect.DetachingMap)
last_verified: Fri Jul 01 13:07:08 UTC 2022
provenance: (class org.sonatype.nexus.common.collect.DetachingMap)
hashes_not_verified: false
pypi: (class org.sonatype.nexus.common.collect.DetachingMap)
summary: The PyPA recommended tool for installing Python packages
author: The pip developers
description: ...
content:
etag: c849a44121f823c806f604d6568d9e89
last_modified: Fri Oct 22 15:57:10 UTC 2021
org.sonatype.nexus.repository.view.Content
etag: c849a44121f823c806f604d6568d9e89
last_modified: 2021-10-22T15:57:10.000Z (class org.joda.time.DateTime)
hashCodesMap: (class java.util.HashMap)
org.sonatype.nexus.common.hash.HashAlgorithm@3d97cbd0: deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d, org.sonatype.nexus.common.hash.HashAlgorithm@675317cb=c849a44121f823c806f604d6568d9e89
org.sonatype.nexus.common.hash.HashAlgorithm@67bcbee7: bcbb583a5a4b4767de8ac020dea3d54011fee961
org.sonatype.nexus.repository.storage.Asset: (class org.sonatype.nexus.repository.storage.Asset)
metadata: (AttachedEntityMetadata)
schema: assetPath
document: (#74:0)
bucket: #57:1
format: pypi
last_updated: Fri Jul 01 13:25:15 UTC 2022
attributes: [5]
component: #65:0
name: packages/pip/21.3.1/pip-21.3.1-py3-none-any.whl
size: 1723581
content_type: application/zip
created_by: anonymous
created_by_ip: 80.78.253.49
blob_ref: default@E1F281C2-0A159DAD-4208CEFD-524F990B-0B4DDE11:739a4ecb-73fc-4422-a7d7-c93c8ad069c6
last_downloaded: Fri Jul 01 04:44:03 UTC 2022
blob_created: Wed Jun 29 07:01:34 UTC 2022
blob_updated: Wed Jun 29 07:01:34 UTC 2022
name: packages/pip/21.3.1/pip-21.3.1-py3-none-any.whl
org.sonatype.nexus.repository.cache.CacheInfo: (class org.sonatype.nexus.repository.cache.CacheInfo)
lastVerified: 2022-07-01T13:25:14.841Z
cacheToken: 'null'
25 - Renders
Repository-owned render assets and their acceptance evidence
This project owns reusable Blender assets, their controlling references, and
acceptance evidence bound to exact candidate bytes. Maintained work uses the
project OpenSpec workspace.
The Reimu Fumo work lives under assets/reimu_fumo/. Its
reusable asset target will be added only after a candidate passes the visual,
structural, animation, and exact-byte delivery gates in
Reimu Fumo change. That change
preserves the open outcome, blocked execution and original goal history.
Working candidates and intermediate renders belong under the repository-root
out/reimu_fumo_finish/ directory. They are not accepted or durable merely
because they exist there. A historical packet may move into the source tree
only when exact bytes and provenance are verified and it is labeled with its
actual rejected or accepted state.
26 - Sri
Command-line Subresource Integrity calculator using OpenSSL
sri calculates Subresource Integrity hashes for files using OpenSSL. Its
command-line interface accepts an input file and a digest algorithm, such as
SHA-256.
Links
Features
- Cli app that calculates SRI using OpenSSL
- C, OpenSSL
Usage
Usage: sri [OPTION...]
Generate sri of a file
Example:
bazel run //projects/sri -- --digest sha256 --file ${PWD}/README.md
-d, --digest=String Digest type (sha256, for example)
-f, --file=Path Path to the file to parse
-?, --help Give this help list
--usage Give a short usage message
27 - Tf modules
Reusable Terraform modules for Vault, virtual machines, storage, and Vast.ai
This project contains reusable Terraform modules for Vault configuration,
Proxmox virtual machines, backup storage, and related infrastructure. The
module collection is still in progress. The Vast.ai team module
composes managed or existing teams and project API keys while callers select
provider credentials and own secret storage.
The base image-generation module owns
constrained rentals and SSH-only or password-protected HTTPS access with at least
32 GiB VRAM. Forge and
ComfyUI modules supply native runtime
configuration and model paths. Creating a consumer does not authorize a paid rental.
The TrueNAS dataset module creates a protected child
from parent and inline config, with shared defaults, private account ownership
and optional standard SMB exports.
Links
Features
27.1 - Backup bucket
S3 bucket for backups
27.2 - DNS records
Canonical DNS declarations for Cloudflare and RouterOS
This reusable module translates an owner’s decoded dnsconfig.json through
its provider-free normalizer, then manages individual
global Cloudflare and dc1 RouterOS records with caller-provided providers.
Owners with only global records use the global entrypoint,
which needs only Cloudflare. The combined entrypoint delegates Cloudflare
resources to that same module and consumes its normalization for RouterOS.
Repository infrastructure roots may consume its Bazel source filegroups;
the child normalizer also supports provider-free inspection.
module "dns" {
source = "../../../projects/tf_modules/dns_records"
document = jsondecode(file("${path.module}/../dnsconfig.json"))
cloudflare_zone_id = var.dns_cloudflare_zone_id
enabled = var.dns_enabled
}
zone defaults to alwaldend.com. An explicit cloudflare_zone_id is optional;
when it is null or empty, enabled global records resolve exactly one Cloudflare
zone matching zone. The token must permit zone listing and reading. Disabled
ownership and declarations without global records skip this lookup.
enabled defaults to false so a prepared root owns
no provider records. Keep it true after adoption: setting it false in a state
that already owns records plans deletion and is not a rollback procedure.
Disabling ownership does not suppress provider initialization. Operational
Terraform commands still require the caller’s real provider configuration
and the owning Vault/AppRole prerequisites. In particular, the pinned
RouterOS provider probes its configured API even when no DNS records are
enabled. Use the provider-free normalizer for offline inspection.
The migration runbook
owns cutover, import, and rollback ordering. This module supplies no provider
credentials or state backend.
The input contains exactly one records object. Each stable logical key
contains one or more scalar type members and a nonempty dsp list. Supported
destinations are global, dc1, and all; repeated destinations are deduplicated.
| Type | Required member fields | Default TTL |
|---|
| A | name, address | 300 |
| AAAA | name, address | 600 |
| CNAME | name, target | 600 |
| NS | name, address | 300 |
| MX | name, target, priority | 300 |
| TXT | name, content | 300 |
Every member accepts an integer ttl from 60 through 86400 seconds. MX
priorities range from 0 through 65535. Multiple scalar values at the same
name and type use distinct logical keys; changing values never changes
resource identity. Unsupported fields and malformed members are rejected.
Names accept @, relative names, or zone-qualified names. Absolute owner
names ending with a dot must be inside the zone. CNAME, MX, and NS targets
accept @, relative names, zone-qualified names, or absolute external names
ending with a dot. Normalization lowercases domain names and omits final dots;
address and TXT bytes are preserved. relative_name is @ at the apex.
normalized_records maps logical_key/type/view to key, name,
relative_name, type, value, priority (null except MX), ttl, view,
and proxied (always false). This output remains available while disabled.
The same keys index module.global.cloudflare_dns_record.records and
module.dc1[0].routeros_ip_dns_record.records in the combined entrypoint; the global-only
entrypoint uses cloudflare_dns_record.records. import_addresses exposes
these addresses relative to the selected module, including while staged.
The pinned providers import Cloudflare
records by zone_id/record_id and RouterOS records by static IDs such as *1A.
Terraform tests use mocked providers and pinned local provider packages.
The global-only test root has no RouterOS provider dependency. Normalization
tests require no providers. Both run without network access;
they establish declaration and resource mapping behavior, not live adoption.
27.2.1 - DNS normalization
Provider-free canonical DNS declaration transformation
This child module owns the canonical transformation described by the
DNS module. Its document and zone inputs produce
normalized_records without a provider, backend, or managed resources.
Terraform writers and provider-free inspection consume this output.
27.2.2 - DNS test providers
Pinned provider packages for offline Terraform tests
The test target uses the public
rules_terraform wrapper with
the same Cloudflare, RouterOS, and Proxmox provider labels as infrastructure
targets. The shared extension owns provider versions, release URLs, and
checksums. Bazel fetches the declared archives before tests execute; Terraform
uses the wrapper’s packaged filesystem mirror without a registry fallback.
Each regression runs Terraform in a caller-owned temporary module directory.
Tests retain an explicit environment without inherited provider credentials;
provider installation and mocked lifecycles require no network access.
The targeted import regression matches the owning Proxmox provider block by
omitting pm_api_url. It checks both empty state and existing Proxmox resource
state with no credentials. Without PM_API_URL, provider validation fails
before target pruning; supplying only a loopback endpoint permits the DNS
operation. The endpoint must receive zero requests.
The test imports a built-in Terraform resource through a root map into
module.dns, checks the exact no-op import, applies that saved plan, and verifies
the next targeted plan has no changes. Existing Proxmox resource attributes
remain unchanged. An untargeted control must fail authentication before
contacting the endpoint. These checks cover provider selection and state
preservation; live DNS adoption retains its separate inventory and plan checks.
27.2.3 - Global DNS records
Cloudflare-only entrypoint for canonical DNS declarations
Global-only owners use this entrypoint with the shared module API
to avoid requiring RouterOS configuration. The combined module also delegates
its Cloudflare resources here, so both entrypoints share one implementation.
Normalization returns all declared views, but this entrypoint owns only global
records. Mixed-view owners use the parent module to manage dc1 as well.
Enabled global records use the explicit cloudflare_zone_id when supplied.
Otherwise, the pinned cloudflare_zone data source resolves the configured
zone name and rejects missing or ambiguous matches. This requires zone-list
and zone-read access in addition to record permissions. Disabled ownership and
declarations without global records perform no zone lookup.
The optional zone ID must be known during planning so Terraform can select
whether discovery is needed. The repository’s AL injection supplies a known
value or an empty string before Terraform starts. Zone-name discovery uses the
normalizer’s canonical name, including case and final-dot handling.
import_addresses contains global addresses relative to this entrypoint.
record_ids exposes bound Cloudflare IDs for adoption and identity checks.
27.3 - OpenSpec
27.3.1 - Specifications
27.3.1.1 - Dns records
27.3.1.1.1 - dns-records Specification
Purpose
Provide one canonical DNS transformation for project-local Terraform resources
and offline inspection, preserving declared names, values, and view ownership.
Requirements
Requirement: Normalize canonical declarations without providers
The module SHALL accept decoded owner DNS documents and a zone, flatten every
supported type member, expand and deduplicate destinations, and expose one
normalized map without provider configuration. It SHALL reject unsupported
types, destinations, malformed members, and absolute names outside the zone.
Scenario: One logical declaration has several types and destinations
- WHEN an entry contains A and AAAA with destinations all and global
- THEN normalization produces exactly four records, one per type and view
Requirement: Preserve record multiplicity and stable identities
Normalized and provider resource keys SHALL use logical declaration key, type,
and view without mutable record values. Separate logical keys SHALL preserve
multiple records at the same name and type, including MX priority and TXT values.
Explicit TTLs SHALL override the type-specific compatibility defaults.
Scenario: A record changes address
- WHEN an A member changes its address without changing its logical key
- THEN its normalized and provider resource keys remain unchanged
Requirement: Keep provider ownership explicit
The module SHALL accept provider instances from its caller and create individual
Cloudflare global and RouterOS dc1 records only when explicitly enabled. It SHALL
default to disabled provider ownership while preserving normalized outputs.
Cloudflare records SHALL remain unproxied.
Disabled ownership SHALL NOT imply that operational provider initialization
or credential prerequisites are suppressed.
Scenario: A root prepares a future migration
- WHEN a root calls the module without enabling ownership
- THEN it declares no provider record resources and still exposes every normalized declaration
27.3.1.2 - Project dns
27.3.1.2.1 - project-dns Specification
Purpose
Record the retirement of this project’s landing DNS infrastructure while
preserving its repository documentation and builds.
Requirements
Requirement: Keep landing infrastructure retired
The project SHALL have no dedicated landing DNS declaration, Terraform root, or
operational source export. Its landing page SHALL be published by the main site
under /projects/tf_modules/ instead of a dedicated hostname.
Scenario: Inspect the project after landing retirement
- WHEN the project tree is consumed
- THEN it contains no landing DNS declaration, Terraform DNS stage, or
landing build target, and the main site owns its landing page.
27.3.1.3 - Project tf modules
27.3.1.3.1 - Reusable Terraform modules
Purpose
Provide reusable infrastructure declarations for Vault, virtual machines,
storage, and related services. This baseline was observed at repository
revision 550d7e79 on 2026-09-08. The collection remains in progress according
to its README. Sources for the
representative module contracts below are the
AppRole module,
transit-key module,
backup-bucket module, and
module packaging.
These are declarative source contracts; no live provisioning is asserted.
Requirements
Requirement: Package reusable module source
The AppRole, transit-key, backup-bucket, and Proxmox VM module packages SHALL
each expose their main.tf through a same-named Bazel filegroup available to
repository subpackages.
Scenario: A repository target consumes a module
- WHEN a target depends on
//projects/tf_modules/vault_approle:vault_approle - THEN its declared source input includes the AppRole module’s
main.tf
Requirement: Associate AppRoles with Vault identities and policies
The AppRole module SHALL declare an identity entity, backend alias, internal
group, and named AppRole with configurable token and secret-ID limits. Its
role policies SHALL combine the shared and AppRole-secret policies with caller
policies and the Yandex-folder policy unless that policy is disabled for the role.
Scenario: Caller disables the Yandex-folder role policy
- WHEN
disable_yc_folder_policy is true - THEN the role’s policy list excludes the module’s Yandex-folder policy while preserving shared, AppRole-secret, and caller policies
Requirement: Separate transit encryption and decryption membership
The transit-key module SHALL declare a named Vault transit key, an encryption
policy and group, and a decryption policy and group. Decryptor member groups
SHALL also be included in the encryption group.
Scenario: A group is listed as a decryptor
- WHEN a caller adds a group ID to
decryptors_member_group_ids - THEN the module includes that group in both transit permission groups
Requirement: Declare encrypted versioned backup storage
The backup-bucket module SHALL declare a versioned Yandex storage bucket with
default KMS encryption, grant read and write permissions to the supplied
service accounts, and store bucket identifiers in the caller-selected Vault
KV v2 location.
- WHEN the caller supplies the bucket name components, folder, service accounts, and Vault destination
- THEN the declarations bind bucket encryption to the module’s KMS key and publish the bucket ID, folder ID, and bucket name to that Vault destination
27.4 - Pve vm qemu
Create a proxmox vm
27.5 - Terraform backend
Module that sets up an S3 terraform backend
27.6 - TrueNAS dataset
Creates a protected child dataset and its private account ownership from
parent and config. The module owns lz4 compression, atime OFF, owner-only NFSv4 ACLs and inherited encryption. Owner defaults to root; copies
follow the parent and quota is unset unless overridden. Set traverse = true for a shared traversal parent.
The caller supplies the provider and deployment authorization.
Optional smb creates a non-browsable, authenticated DEFAULT_SHARE after
filesystem ACLs are applied. A share ACL allows only its owner and MODIFY
delegates. Its name defaults to the dataset child name; hosts
restricts access to those clients and denies everyone else when nonempty.
Global SMB transport encryption remains the NAS root’s responsibility.
See the runner configuration
for a complete consumer. That AppRole project has its own state and targets.
No separate owner lookup, permission resource or share resource is needed.
Passing a parent module’s name establishes ordering. This module does not create
missing ancestors or accept nested paths as child names.
access grants named accounts MODIFY (inherited) or TRAVERSE (this path only).
Traversal-only accounts cannot connect to the dataset’s SMB share. Named owner
access is inherited so files created by delegates remain accessible to the owner.
MODIFY ACL changes apply recursively within this dataset, without crossing child
dataset mounts. The parent namespace owner must separately allow traversal to
reach a shared child; the AppRole storage project owns that grant for the runner cache.
27.7 - Vast.ai ComfyUI instance module
Provision a loopback ComfyUI runtime with authenticated HTTPS
This module composes the base rental
with the native Vast ComfyUI service at 127.0.0.1:18188. Supply a reviewed
vastai/comfy image. It forwards access, credential, offer, storage and connection
interfaces, retaining SSH-only access by default. workspace_directory defaults
to /workspace and is exported before native workspace initialization. For
example, /srv/imagegen places the bundled application at /srv/imagegen/ComfyUI.
Paths must be absolute and contain no traversal, whitespace or shell syntax.
Changing this boot setting is a provisioning change, not a migration of existing
models, uploads or outputs.
Terraform owns rental constraints, the initial restrictive runtime and access
bootstrap. It does not install model files, LoRAs, node packs, Python dependencies,
first-party sources or workflows. Use the shared
comfyui_tools Ansible role
for those inputs and subsequent updates without changing paid-instance startup.
The generic base retains its native provisioner interface for the separate Forge
consumer; this wrapper supplies an empty application manifest.
ComfyUI initially uses --disable-all-custom-nodes --offline; Manager and
partner API nodes are disabled, no wildcard CORS flag is supplied, and the
frontend receives ComfyUI’s restrictive offline Content-Security-Policy.
Ansible appends the installed node directories to its whitelist and manages the
COMFYUI_ARGS line in /etc/environment, marked # imagegen-ansible. Boot
preserves that marked line; otherwise it supplies the restrictive defaults.
These controls limit exposure and are not an outbound firewall.
The bundled API wrapper stays on loopback 127.0.0.1:18288, included in the
local portal inventory but never routed by the public proxy. Portal, Jupyter
and TensorBoard remain local; tunnels, synchronization and workers remain disabled.
Only the dedicated TLS and Basic-auth proxy is published in exposed mode.
module "imagegen" {
source = "../../../projects/tf_modules/vastai_instance_imagegen_comfyui"
image = "vastai/comfy:v0.44.0-cuda-12.9-py312"
workspace_directory = "/workspace"
}
runtime.json owns the baseline service, arguments, model-directory map and
application name. The deployment passes that map to Ansible, selecting
models/checkpoints for SDXL all-in-one checkpoints and the default
models/diffusion_models for standalone denoisers. LoRAs use models/loras,
ControlNet uses models/controlnet, and other kinds retain their declared paths.
The separate ephemeral evaluator also consumes this declaration; its evaluation
lifecycle continues to own its native provisioner recipe.
Vast’s source
owns the image boot contract. ComfyUI’s native arguments
own offline and node behavior. Offline Terraform fixtures cover both access
modes, alternate workspace validation, empty application provisioning and
proxy/forwarding ports. Actual image boot and GPU generation require separately
authorized live acceptance.
27.8 - Vast.ai Forge instance module
Native Forge settings on the shared image-generation rental
This module composes the base rental
with the native Vast Forge service at 127.0.0.1:17860. Supply a reviewed Forge
image through image. It forwards the base’s access, credential, offer, storage,
and connection interfaces, retaining SSH-only access by default.
Model kinds map below /workspace/stable-diffusion-webui-forge:
| Kind | Directory |
|---|
checkpoint | models/Stable-diffusion |
lora | models/Lora |
vae | models/VAE |
embedding | embeddings |
text_encoder | models/text_encoder |
Optional model_selection selects a declared checkpoint, native preset,
encoder/VAE modules, integer steps and cfg_scale. Native JSON config sets
both global and preset-specific keys through --ui-settings-file. Omitting it
preserves the image defaults. These creation-time settings replace a rental.
Consumers previously using the base’s Forge-specific interface must change
source to this wrapper. A live instance gains a nested module.imagegen state
address and requires an explicitly reviewed migration or replacement; changing
source is not authorization to perform either. The personal consumer’s previous
rental was destroyed before this refactor.
module "imagegen" {
source = "../../../projects/tf_modules/vastai_instance_imagegen_forge"
image = var.forge_image_reference
}
27.9 - Vast.ai image generation instance module
Shared Vast rentals with SSH-only or password-protected HTTPS access
This module rents one GPU with at least 32 GiB VRAM, using a caller-selected Vast-native image.
The default mode is ssh_only; exposed publishes the application through HTTPS and a
caller-supplied username/password. The caller supplies provider authentication
and secure state. The image-generation infrastructure project
generates and stores its login in Vault before creating the paid instance.
Building and testing these definitions does not deploy or rent capacity.
The shared offer declaration caps both download and upload transfer rates at
USD 0.04/GB, in addition to hourly-price and host requirements. The evaluator
inherits these same predicates; it does not maintain a second bandwidth policy.
Runtime modules
Use the Forge wrapper or
ComfyUI wrapper for application
configuration. This base owns offer selection, rental lifecycle, authentication,
and the native download manifest. Runtime wrappers own model directories,
loopback arguments, optional JSON configuration and local portal entries.
No image discovery or registry lookup runs during Terraform planning. The caller
selects an explicit published image tag; changing it replaces an existing rental.
The base supplies a plain startup script and opts into the provider’s gzip
transport. The provider owns encoding and the 16,384-byte API command limit;
the selected Vast images provide the required shell utilities.
By default no template_hash_id is sent, avoiding the stock template’s public
ports and unrelated provisioning configuration. Configure model_downloads for
automatic first-boot downloads rather than editing a public template.
An optional reviewed Vast-native template_hash_id can provide environment
settings, including model provisioning. Copy and review it first, removing
all Docker flags except literal -e NAME=value or --env NAME=value assignments.
Missing/malformed metadata, published ports, host networking, and other Docker
flags fail closed. The explicit image overrides the template image. Credentials
must never be stored in a saved/public template. Mutable scripts/URLs and
arbitrary extensions remain trusted code, outside the network guarantees below.
Access and local services
| Mode | Public application access | Authentication |
|---|
ssh_only (default) | No web port requested; Caddy disabled | Vast account SSH key and forwarding |
exposed | Only application proxy, container 7860/tcp | TLS plus HTTP Basic username/password |
Each wrapper fixes its application listener to loopback in both modes. Local tools are retained:
Instance Portal at 127.0.0.1:11111, Jupyter at 127.0.0.1:18080, and TensorBoard
at 127.0.0.1:16006. Access them through SSH forwarding to the corresponding
internal port. They are not published by the proxy. These local management
interfaces can provide unauthenticated shell/file access, so only trusted local
processes and SSH users belong on this instance.
Cloudflare tunnel management, Syncthing (including outbound relays), and the
serverless worker are disabled. Other bundled services retain their native defaults. The inspected ComfyUI image declares diagnostic 3000/tcp in its Docker metadata;
the instance test runner is explicitly disabled and no publish-all flag is used. The module requests only the SSH service, plus
-p 7860:7860 in exposed mode. Verify actual listeners during live acceptance;
reviewed provisioning code can still start additional listeners or outbound traffic.
Exposed mode requires web_password with 32–64 alphanumeric characters and a
web_username starting with a letter and containing letters, digits, or underscores
(maximum 64 characters). Generate a random password in the caller. The restricted
alphabet prevents shell substitution. The dedicated proxy hashes the password
with bcrypt, authenticates every path, and has no portal, URL-token/cookie bypass,
plaintext redirect, access log, or Caddy admin API. HTTP/3 is disabled. Missing
or invalid TLS files fail proxy startup instead of falling back to plaintext.
It uses the selected image’s bundled Caddy, not an additional downloaded proxy.
Portal/CLI auto-updates are disabled so boot uses the selected image’s bundled
services. Startup controls service exposure; it is not an outbound firewall or a
privacy audit of arbitrary application code and extensions. Credentials occur
in sensitive onstart, are sent to Vast, and remain in Terraform state/history.
There are no password outputs; restrict the Vault-backed state accordingly.
Compose
Compose a runtime wrapper rather than configuring the low-level runtime contract
here. Package its filegroup in the consuming Terraform target’s data, and select
//projects/vastai_terraform_provider:provider. Both wrappers forward the base’s
rental inputs and connection outputs. No Vault resources belong in these shared
modules; callers generate and persist their own login before rental creation.
Offer selection requests one verified datacenter NVIDIA GPU, an amd64 host with
CUDA 12.9 compatibility, at least 32 GiB VRAM, 99% reported reliability, 100 GB disk
by default, and one direct port for SSH or two for SSH plus HTTPS. Vast calls its
certified tier Secure Cloud (Datacenter).
The returned offer must confirm hosting_type=1 and verification=verified;
missing tier data, insufficient memory, and excessive hourly price are rejected.
There is no fallback to community hosts or smaller GPUs. min_gpu_ram_gb can
raise the floor. offer_id retains all constraints.
The default USD 1/hour ceiling includes requested disk; it does not cap transfer
charges, continuing storage, or total duration. Marketplace changes do not replace
an existing contract, but each normal plan rechecks availability; an empty eligible
market can block planning. Mode, credentials, image, template, startup, or disk
changes replace the instance. Export wanted images before replacement/destruction.
Model downloads
model_downloads is a list of {url, filename, kind} objects. The URL must be
public HTTPS without embedded credentials; filenames end in .safetensors and
cannot traverse directories. kind selects a directory supplied by the runtime wrapper. The base validates
public URLs, filenames, uniqueness and the presence of a destination for each
kind; it contains no application-specific paths.
Startup writes a local JSON/YAML-compatible manifest and passes it to Vast’s
native provisioner.
The native application launcher waits while /.provisioning exists. Provisioning
runs on the rented machine and downloads to its billable local storage; there
is no model cache preserved after destruction. An empty list downloads no
configured models. SCP/SFTP remains available for manual file transfer.
This interface currently supports public files; do not put gated-model tokens
in URLs or source. Gated downloads need a separately configured Vault-backed
HF_TOKEN/CIVITAI_TOKEN injection. Review model licenses and required space.
Connect and certificates
Configure account SSH public keys before renting. Creation only acknowledges a
contract. After boot, refresh through the caller’s owning workflow. The
ssh_forward_command remains null until SSH details are observed; run it locally
and open local_url (default http://127.0.0.1:7860). Both forwarding endpoints
bind loopback, using the caller’s SSH agent/normal identity configuration.
In exposed mode, https_url remains null until refresh reports both public IP
and the actual mapped 7860/tcp host port. It does not establish application
readiness.
Certificates
The proxy uses /etc/instance.crt and /etc/instance.key. Follow
Vast’s certificate guidance
and verify issuer/fingerprint through a trusted channel before entering the login.
Do not disable TLS validation or blindly bypass warnings. No DNS or publicly
trusted domain certificate is configured by this module.
Privacy
Applications run on the rented machine; output files and prompt/image metadata
may persist locally. Extensions and provisioning code may access them and make
network requests. This module adds no prompt-sharing service. Runtime-specific
controls are described by each wrapper; none establish confidentiality from the
host administrator or a no-training commitment for the complete stack.
Vast’s privacy policy covers account/website processing.
Certified datacenter status does not prevent the host administrator accessing the
workload. See the infrastructure project’s privacy boundary
for host trust and retention limits. Stopping retains billable storage; export
wanted files before destruction. This project cannot verify physical erasure or
exclude host-made copies.
Validation
bazel test //projects/tf_modules/vastai_instance_imagegen:all
bazel test //projects/vastai_terraform_provider/test/acceptance:acceptance_test
The base and both wrappers run through pinned Terraform/provider against a loopback API
fixture: both modes, unsafe templates/credentials, memory/tier rejection, sensitive
output, replacement, and mapped URLs. imagegen-lifecycle.json and
imagegen-https.json are repeatable undeclared test outputs. No GPU is rented.
Actual image boot, TLS/authentication, management-service bindings, model loading,
and image generation remain unverified without a scoped live acceptance run.
The common offer filters are declared once in offer_defaults.json; callers add
their hardware, storage, port and price bounds. The ephemeral evaluator reuses
those filters and the same startup.sh.tftpl through pure template compilation.
Terraform still owns this module’s regular rental lifecycle; it does not own
evaluation resources.
27.10 - Vast.ai team module
Team and project API-key composition with caller-owned authentication
This module declares one Vast.ai team and a map of project API keys through the
in-tree provider. It declares no compute or Vault resources. The caller selects
the provider and owns state and secret storage. Generated key outputs are
sensitive and belong directly in secret resources.
A new team receives zero credits. Its project keys use the management key
generated during the same apply. Existing module resource addresses and outputs
remain unchanged; upgrading a managed team requires no state migration.
For an existing owned team, import its numeric account ID into the module’s
vastai_team.team resource before applying keys. Import reads identity without
creating a team or recovering an old secret. Imported teams have no management
key, so project keys use the caller’s configured provider and the imported team
ID. This binding requires permissions = "" for default full access. There is
no separate existing-team input or ownership mode.
provider "vastai" {
alias = "issuer" # VAST_API_KEY is injected from Vault.
}
module "alwaldend" {
source = "../../../projects/tf_modules/vastai_team"
providers = { vastai = vastai.issuer }
name = "alwaldend"
api_keys = {
rentals = { name = "infra_vastai_alwaldend", permissions = "" }
}
}
Use the owning root’s packaged import command with address
module.alwaldend.vastai_team.team and the verified account ID. If another
Terraform address or state already owns that team, migrate that ownership
instead of importing a duplicate. A plan for an imported team must show no team
creation or replacement. Imported team destruction is refused; cleanup can
revoke the declared project keys without deleting the existing team.
The provider verifies the generated key’s team selection before returning its
sensitive value. Rejected selection fails apply and leaves a tracked key for
explicit cleanup. Instantiate this module with for_each for multiple teams.
Vault identity and destination paths belong to the caller; the module grants no
Vault permissions.
Terraform CLI fixtures verify managed bootstrap, imported-team key creation,
rejected activation and scoped input, unchanged plans and addresses, and key
cleanup while preserving imported teams. They require no live account. Live
alwaldend activation remains blocked by the recorded HTTP 400 response.
27.11 - Vault approle
Create a vault approle
By default the member group grants AppRole bootstrap permissions. The role’s
own KV namespace policy stays on the role token. Set
allow_member_secret_access = true for a personal role whose human members
should also access that namespace directly, including through Vault’s UI.
This reuses the existing namespace policy and group; other roles retain the
default bootstrap-only member permissions.
Opted-in roles also receive list-only permissions on exact metadata ancestors
so the UI can navigate from the mount root. Those listings reveal folder names;
they grant no secret-value access outside the role’s own namespace.
27.12 - Vault approle
Create a vault approle
27.13 - Vault OIDC provider
Vault OIDC provider
27.14 - Vault pki server
Create a pki config for a server
allowed_domains defines permitted certificate names. allow_subdomains
defaults to true for existing consumers; set it to false to permit only
the explicitly listed names. EAB access is granted through
eab_new_member_group_ids for the role-scoped ACME directory.
27.15 - Vault ssh server role
Create an ssh role for a server
27.16 - Vault transit key
Vault transit key
Links
27.17 - Yc folder
Folder for Yandex Cloud
28 - TruffleHog rules
Scan-only Bazel tests with commit-and-line finding allowlists


Diagram key
| State | Details |
|---|
| Scan Git history | Scan HEAD history by default, or all local refs on request. Inline ignores apply only to the revision containing them. |
| Exit status | Raw scanner status: 0 without findings, 183 with findings. Other statuses fail validation. |
| Read stdout | Process findings while the scanner runs, continuing through buffered output until EOF. |
| Apply allowlist | Match detector, path, full commit ID, and line. Preserve original JSON, including suppressed findings. |
| Validate scan | Wait for both stdout EOF and process exit, then check the exit status against finding counts. Any error fails the scan. |
Usage
rules_trufflehog builds from the monorepo root and ships as a standalone Bazel
module with a reusable test rule and Go
scan wrapper. It redeclares existing repository dependency pins.
Git metadata uses TruffleHog’s generated protobuf Go type at the scanner’s
3.99.7 pin. The surrounding CLI output uses ordinary Go JSON, so the wrapper
keeps a small envelope adapter and retains complete original JSON findings.
The module owns the scanner release pin and binary toolchain. The consumer supplies
a Git executable, repository marker, and policy.
The monorepo’s scan targets and allowlist live in tools/trufflehog.
The state-machine source is rendered through the shared site pipeline.
load("@rules_trufflehog//:defs.bzl", "trufflehog_test")
trufflehog_test(
name = "secrets_test",
git = ":git",
repository_marker = "//:AGENTS.md",
allowlist = "allowlist.json",
)
The default scanner is @rules_trufflehog//:trufflehog, selected through the
module’s registered execution-platform toolchain. The module registers every
toolchain generated from its lock; archive execution constraints select a compatible
implementation without another registration in the parent repository. The existing
release archive supports Linux x86-64. The binary lock
owns its version and integrity; the generated Go metadata uses the same version.
Pass scanner only for a custom binary or a controlled test fixture. Its executable
and runfiles replace the default scanner. The public CLI target can also run
directly. This module requires Bazel 9.3.1 or later, matching its binary-toolchain dependency.
Scan scope
The marker must be a file at the Git worktree root. The rule resolves its real
location, merges tool runfiles, and runs without generated shell glue.
HEAD history is the default; all_refs = True includes every local ref.
Both modes disable credential verification and update checks and bypass cached
test results. They do not scan uncommitted or untracked source.
The scanner keeps Git LFS pointers in its temporary checkout and reads the
Git history without fetching LFS payloads.
Use checkout = True to scan the current tracked files with TruffleHog’s
filesystem source. This mode requires a clean tracked checkout and
materialized LFS files. It scans the checkout directly, excluding Git metadata
and untracked paths and leaving symbolic links unfollowed.
Inline trufflehog:ignore comments apply to the revision containing them. Adding
an ignore now does not suppress a finding in an earlier commit.
Exact finding policy
The JSON policy uses schema trufflehog_allowlist/v1 and a findings array.
Each entry contains detector, path, commit, line, and reason.
All coordinates must match the scanner result exactly. Commit IDs must be full
lowercase Git object IDs; lines must be positive. Paths are canonical
repository-relative Git paths. Reasons must be nonempty.
There are no value hashes, regex matches, mutable refs, or abbreviated commits.
Duplicate tuples and unknown policy fields fail before starting the scanner.
A tuple covers results from that detector at the specified immutable source
line. Findings in a different commit or at another line remain actionable.
An entry absent from a branch’s history is valid; stale entries do not fail a scan.
Output and failures
The wrapper writes newline-delimited JSON finding events containing the complete
original result and a suppressed flag, followed by total, suppressed, and
unmatched counts. Approved findings remain available for local inspection.
Scanner diagnostics pass through stderr. Keep original reports in restricted
local storage rather than publishing credential values in a PR.
TruffleHog’s raw exit status must be 0 without findings or 183 with findings.
The wrapper checks it after reading stdout through EOF; any other status or
contradictory finding count fails the scan.
The wrapper returns zero only after a complete scan with no unmatched findings,
183 for unmatched findings, and 1 for policy, execution, or decoding errors.
A scanner error remains an error when every decoded finding is approved.
Both modes always pass --no-verification, --no-update, and
--fail-on-scan-errors.
Use @rules_trufflehog//cmd/scan:scan -- --help for direct flags, or
//cmd/scan:scan from a standalone checkout of the release archive.
Direct invocations require caller-owned TMPDIR; Bazel tests use TEST_TMPDIR.
The E2E command fixture produces e2e-report.json in
undeclared test outputs. rule_test exercises the native rule and runfiles
wiring; the repository consumer exercises the pinned scanner over real history.
Maintained work lives in this project’s OpenSpec workspace. The shared Bazel
configuration is imported through .bazelrc. The repository CLI alias in
tools/trufflehog forwards to the module-owned binary. There is no root third-party
scanner package or separate release pin.
28.1 -
Scan-only TruffleHog tests with exact finding allowlists.
trufflehog_test
load("@com_alwaldend_src//projects/rules_trufflehog:defs.bzl", "trufflehog_test")
trufflehog_test(name, git, repository_marker, allowlist, scanner, all_refs, checkout, tags,
**kwargs)
Runs a fresh Git history or checkout scan without credential verification.
PARAMETERS
| Name | Description | Default Value |
|---|
| name | Test target name. | none |
| git | Consumer-supplied Git executable. | none |
| repository_marker | File at the worktree root. | none |
| allowlist | JSON policy with exact detector/path/commit/line tuples. | none |
| scanner | Optional executable override for a custom scanner or fixture. | Label("@com_alwaldend_src//projects/rules_trufflehog:trufflehog") |
| all_refs | Include all local refs when true. | False |
| checkout | Scan tracked checkout files when true. Requires a clean tracked checkout and materialized Git LFS files. | False |
| tags | Additional tags, such as manual for an all-ref audit. | [] |
| kwargs | Common Bazel test attributes. | none |
28.2 - TruffleHog wrapper command acceptance
These failure cases are defined before implementation:
- Only an exact detector/path/commit/line tuple succeeds; each changed coordinate
and a second unmatched finding must fail without hiding the original records.
- A new commit at the same path and line must not inherit an older suppression.
- Unknown policy fields (including value hashes), malformed or abbreviated commit
IDs, invalid paths, nonpositive lines, missing reasons, and duplicate entries fail.
- Truncated JSON, missing finding metadata, scanner launch failures, timeout,
scanner errors after approved output, and contradictory scanner exit codes fail.
- The scanner must receive
--no-verification, --no-update, and error-failure
flags. HEAD mode skips additional refs; all-ref mode scans all local refs. - Zero findings succeed; fully approved findings retain original values and counts.
- The E2E test invokes the built wrapper and a controlled scanner subprocess,
exercising the pinned JSON protocol without contacting credential services.
It writes
e2e-report.json to Bazel’s undeclared test outputs. The repository
consumer separately exercises the real pinned scanner over Git history.
Scanner-ownership acceptance is defined before changing the rule API:
- Repository scan targets omit
scanner and execute the module-owned pinned
binary through its default toolchain; the retained scan report proves runtime use. - The standalone build fixture includes the public
//:trufflehog CLI, so default
resolution cannot depend on a parent-repository label or binary declaration. - The existing native
rule_test continues to supply its controlled scanner,
exercising override precedence and executable runfiles independently of the default. - Default repository scans and standalone CLI builds must also resolve when the
module alone registers all generated scanner toolchains and the root third-party
package and platform-specific registration are absent.
29 - Useless QT GUI
Desktop GUI application built with C++ and Qt
Useless QT GUI is a desktop application built with C++ and Qt. Its Bazel build
uses a pinned Qt distribution without requiring a system Qt installation.
Links
Features
Build
The Bazel build downloads a SHA-256-pinned Qt 6.8.3 distribution through
rules_qt; a system Qt installation is not required. The project previously
targeted Qt 6.9.0. Using 6.8.3 is a deliberate downgrade to the LTS version
supported and tested by the pinned rules_qt release.
TODO
30 - Vast.ai Terraform provider
Terraform management of Vast.ai compute and team resources


This project implements a Terraform Plugin Framework provider for the
Vast.ai REST API.
The provider type is vastai; the source address is
registry.terraform.io/alwaldend/vastai. This is a development provider;
no Terraform Registry release is published by this project setup.
The shared API client is generated offline from
the official OpenAPI 3.1 schema, pinned by commit and SHA-256. The repository’s
pinned OpenAPI Generator produces Go source directly into Bazel outputs.
The adapter retains endpoint validation and a few operations omitted from the schema.
Coverage
vastai_offers searches GPU offers using a JSON object query and returns
offers in API order: id, gpu_name, num_gpus, gpu_ram_mb, and
hourly_price. An empty search produces an empty list.vastai_template reads exactly one template by hash_id, returning its resolved
image and environment_only classification. Only literal Docker environment
assignments qualify; port mappings, unknown flags, and malformed quoting do not.
Template environment values are not stored in Terraform state. Application
code and provisioning scripts still require operator review.vastai_instance rents an offer with offer_id, Docker image, and
positive disk_gb. Optional creation settings are runtype (default
ssh), sensitive onstart (default empty), and template_hash_id (default
empty). A template hash selects inherited defaults; explicit image, launch,
and startup settings override scalars, while template environment and port
options remain inherited. Use vastai_template to inspect them first. Supported launch modes are
ssh, ssh_proxy, ssh_direct, jupyter, jupyter_proxy, and
jupyter_direct. Changing creation settings replaces the instance.
Refresh normalizes compound API modes and retains a compatible configured
value; imports select a supported mode. Missing or unsupported modes produce
a read error and retain state.compress_onstart (default false) enables gzip transport for compatible images
providing /bin/bash, base64, gzip, mktemp and rm. The provider compresses
the complete script when that reduces its size and enforces Vast’s 16,384-byte
startup command limit before creation. The decoded script runs from a private
temporary file that is removed on exit. Terraform retains the original sensitive
script, and refresh recognizes its encoded API representation without drift.
Changing this creation setting replaces the instance. Oversized commands fail
without a rental request or disclosure of script content.label (default empty) and state (running or stopped, default
running) update in place. Refresh reads drift, observed actual_status,
ssh_host, ssh_port, and public_ip. Destroy terminates the contract;
HTTP 404 during refresh or deletion, or an explicit instances: null in
a successful refresh response, means it is already absent. Missing instance
objects, invalid image/disk/launch metadata, mismatched IDs, and API failures
remain errors and preserve state.
Apply acknowledges the rental or update request. It does not wait for boot,
power-state convergence, or SSH readiness. Connection fields are initially
null; use terraform apply -refresh-only to observe them after provisioning.
Offers can disappear between plan and apply. Stopped instances continue to
incur storage charges. Spot bids, template management, volumes, and
membership management are outside the supported surface.
Non-compute resources
vastai_ssh_key: required public_key, computed numeric-string id.
Updates change public material in place; import uses the key ID. The
provider never generates or stores private keys. Vast.ai may propagate
registered keys to existing instances in the account.
SSH keys require personal account context; Vast.ai rejects them in teams.vastai_environment_variable: required uppercase name and sensitive
value; id equals the name. Values update in place; changing the name
requires replacement. Import uses the uppercase name. Values remain in
state, so use a secure backend.
Masked API reads preserve the stored value and cannot detect external value
changes. After importing a masked variable, configure its value for the next apply.vastai_team_role: required name and requested JSON-object permissions, computed
id (role name), numeric role_id, and effective_permissions including
Vast.ai’s baseline grants. Permissions update in place;
changing the name requires replacement. Import uses the role name. The
resource does not assign or invite members.
Names containing a forward slash are retained as one encoded API path segment.
Refresh compares effective permissions with their previous observed value to
detect drift while preserving configured permission categories. Imported roles
may require an apply to establish that configured representation.
vastai_team creates a separate team with zero credit transfer and generates
an independent management key in sensitive state. vastai_api_key generates
a project key using its configured provider, name, and JSON permissions;
its computed key is sensitive. Key name, permission, and team-binding changes
require replacement. Optional team_api_key is reserved for a management key
generated during the same bootstrap apply. Ordinary resources omit it. Removing
that override verifies key visibility through the provider and updates only
state metadata, preserving the generated key ID and value. A new explicit
bootstrap issuer retains replacement behavior because it can select another team.
An empty permission string omits the permission field and requests default
full access; {} is not equivalent. Optional team_id resolves an existing
owned team’s owner context, retains the new key in state, and attempts binding
only on that generated key. It requires empty permissions for explicit full
access and rejects scoped input before key creation. Computed bindings may require
read-only team refresh before validation. The issuer is never switched. Binding failure
fails apply before downstream Vault storage and leaves the key recoverable by
destruction. Offline fixtures verify this behavior; the live alwaldend attempt
created a key but received HTTP 400 from context selection, so that binding
has not passed live acceptance. The failed key was revoked through its root.
Their generated credentials cannot be recovered through import. API-key
imports remain unsupported. Use a secure backend and pass generated keys
directly to your secret manager rather than Terraform outputs.
An existing owned team can be imported by numeric account ID. Import and
refresh read the personal account’s owner-context metadata without generating
keys or changing credential context. Imported teams have null api_key and
management_key_id; project keys can instead use the configured provider and
the imported team ID.
Their destruction is refused while they remain in state; use prevent_destroy
in their configuration and an explicit state-removal workflow to detach them.
Confirmed external absence removes an imported identity without key cleanup.
Import failures and refresh errors preserve account resources.
terraform import vastai_team.existing 846045
Team deletion requires a private record of confirmed creation and uses the
captured account ID. Failed creation never adopts an existing team with the
same name. If a team is deleted externally, refresh retains its management key
and plans replacement; apply revokes that key before creating another team.
Failed key revocation retains state for an explicit retry.
The account root owns team creation and
account defaults. The separate alwaldend root
uses its operator-provided team key as provider authentication and creates
full-access project keys directly in that context. Rentals use an independent
root and state.
The former isolated live test root and test team are retired. Its test key,
environment marker and role were destroyed through their original state before
revoking the team’s credential. Offline Terraform CLI acceptance fixtures
continue to exercise non-compute resources, team bootstrap and cleanup.
Build and develop
bazel build //projects/vastai_terraform_provider
Use a private Terraform CLI configuration with a development override pointing
at the directory containing the built terraform-provider-vastai executable:
provider_installation {
dev_overrides {
"registry.terraform.io/alwaldend/vastai" = "/absolute/path/to/provider/directory"
}
direct {}
}
Set TF_CLI_CONFIG_FILE to that private file. With a development override,
run terraform validate, plan, and apply directly; terraform init would
attempt Registry resolution for this unreleased provider. In configurations
with other providers, initialize those separately as Terraform requires.
The provider uses protocol 6 and requires Terraform 1.0 or newer.
Inject the API credential as VAST_API_KEY from your secret manager. The
optional sensitive provider attribute api_key overrides it; avoid literal
credentials in configuration. endpoint defaults to
https://console.vast.ai/api/v0. Custom endpoints require HTTPS, except
literal loopback HTTP for fixture testing. Requests have a 60-second timeout
and an 8 MiB response limit, reject redirects, and do not retry mutations.
Inspect the account after an ambiguous creation failure before retrying.
Sensitive attributes are hidden from normal CLI display but remain in state.
Secure Terraform state and saved plans. API response bodies and returned
instance credentials are never copied into diagnostics or persisted state.
terraform {
required_providers {
vastai = { source = "alwaldend/vastai" }
}
}
provider "vastai" {}
resource "vastai_instance" "worker" {
offer_id = 123456 # Select a currently available on-demand offer.
image = "ubuntu:24.04"
disk_gb = 20
label = "terraform-worker"
}
The checked-in example separates offer discovery
from explicit offer selection so refreshing volatile search results does not
replace an existing rental.
Import
terraform import vastai_instance.worker 12345678
Import accepts a canonical positive decimal contract ID. The API does not
return the original offer ID. Before applying imported resources, supply a
placeholder positive offer_id and add
lifecycle { ignore_changes = [offer_id] }. Reconcile image, disk_gb,
runtype, onstart, label, and state with the imported state. Review the
plan carefully; creation-only differences require replacement. When replacing
an imported instance deliberately, remove the ignore rule and select a valid
current offer first.
Validation and ownership
bazel test //projects/vastai_terraform_provider/test/acceptance:acceptance_test
The acceptance suite runs the repository-pinned Terraform CLI and built
provider against a loopback fixture. It exercises the full lifecycle,
replacement plans, import, drift, remote disappearance, failure diagnostics,
and credential-safe redirect handling. lifecycle.json in test undeclared
outputs records the observed non-sensitive API operations. It requires no
Vast.ai account, network access outside loopback, or paid instances; live
compute compatibility remains unverified.
The configured image-generation case packages every public model profile
through its real module and compressed startup transport. It compares staged
workflow contents and model destinations and enforces the 16 KiB API limit,
emitting one configured-imagegen-startup-<profile>.json artifact per profile.
It downloads no weights and establishes no model inference or image quality.
On 2026-11-04, the authorized live deployment applied the project AppRole,
team/token bootstrap, and the three-resource team test root. Both Vast.ai
Terraform roots then produced no-change plans using their own credentials.
No compute was rented or credit transferred; the personal bootstrap context
remained unchanged.
cmd/terraform-provider-vastai owns plugin startup. internal/provider owns
provider configuration and registration; internal/resources owns resource
schemas, plans, state, and imports; internal/datasources owns offer queries.
internal/providerdata defines the shared Data payload and checks it during
resource and data-source configuration. The shared internal/vastai_sdk owns generated endpoint operations,
bounded transport, and API response contracts.
openspec contains the maintained implementation record.
Instance networking options
vastai_instance.docker_options supplies creation-only Docker environment and
port options, merged with the selected template. It is sensitive in normal
Terraform output but retained in state; changes replace the instance. The
provider never reads API-returned environment contents. Computed mapped_ports
returns observed host ports keyed by container port/protocol, such as 7860/tcp.
Connection details remain null before refresh; ambiguous or invalid bindings
fail refresh while retaining prior state.
31 - X Article uploader
Compile a Markdown blog post into a DraftJS content_state and create an X Article draft
This project compiles a blog post into an X Article draft. It has two
operations with different inputs, outputs, and trust requirements:
- Conversion compiles a post’s Markdown body into the DraftJS
content_state document the X Articles draft endpoint accepts. It is
offline, deterministic, and credential-free; it performs no network access. - Draft creation resolves the body images and article banner through the
media upload endpoint, then creates an X Article draft. It is the only
operation that performs network calls, and the only one that needs
credentials. The uploader creates drafts only and never publishes.
Splitting the two lets a draft be produced and diffed offline before anything
reaches X, and keeping the tool to draft creation means no invocation of it can
make a post publicly visible.
What conversion does
A source post is YAML front matter plus a Markdown body. The front matter is
metadata: its title is placed in payload alongside content_state because the draft
endpoint requires a title that content_state cannot carry, and it never
appears in the article text. A source without a non-empty title fails
conversion.
The first entry in front matter images, when present, supplies the article
banner. It must name a supported raster image relative to the post package;
remote URLs, missing files, and references outside the package fail offline
conversion. Later entries do not become additional banners. Conversion records
the selected image in an optional banner_locator with its path, post package,
media type, and content digest. It does not add a body image for the banner.
Every explicit Markdown image remains in the article body, including opening
images and repetitions of the selected banner. Front matter images selects
the banner independently: it neither inserts nor removes body images. Identical
banner and body bytes still share one media upload. Posts and older artifacts
without a banner remain supported.
Markdown maps onto the vocabulary the API exposes:
- Headings clamp:
#/## to header-one, and ### and deeper to
header-two. The API schema lists header-three, but the live draft
endpoint returns HTTP 503 for it. A controlled upload of the complete
47-block showcase succeeded after changing only its header-three block
to header-two. This follows the same
workaround implemented by Postiz. - Paragraphs, both list kinds, nested list items, and block quotes map onto
their matching block types.
- Bold, italic, and strikethrough become
inline_style_ranges; links become
link entities. Offsets are UTF-16 code units of the block’s final text,
matching how the document is interpreted as a JavaScript string. A link or
image destination resolves the Markdown escapes and character references the
source may carry, so the recorded URL or path is the one the author wrote. - Fenced code and tables become
atomic blocks backed by a mutable markdown entity
that preserves the original Markdown, because X has no table block or entity. - Footnotes become a trailing
Footnotes heading with each definition as an
ordered list item. - An inline-code span keeps its text; because DraftJS has no code style, the
lost styling is reported as a continuing diagnostic. A thematic break becomes
an
atomic block backed by a divider entity. - An image wrapped in a link, such as
[](target), is still
emitted as an image; because the image carries no text span, the link cannot
become a link entity over it, so the lost destination is reported as a
continuing diagnostic naming the target. When the link also carries text,
that text keeps the destination and the image’s lost link is still reported,
so the outcome does not depend on whether unrelated sibling text happens to
exist. A link or image title has no place in the entity data object, so its
loss is reported the same way. - Each body image becomes an
atomic block with an unresolved image entity. Its
source travels beside the document as a locator, because the entity’s data
object rejects additional properties. An image whose media type the upload
endpoints reject is reported instead of being emitted as an entity publication
could never resolve.
The uploader supports static image/jpeg, image/png, image/gif, and
image/webp files no larger than 5,000,000 bytes, matching the documented
simple-image upload formats and limit.
Animated GIF, APNG, and WebP are refused explicitly; this tool does not implement
the separate animated-media upload contract. BMP, TIFF, PJPEG, and SVG are not
supported by this uploader. The initialize endpoint’s broader MIME enumeration
does not establish support in the simple-upload path used here.
Conversion and draft preflight apply the same checks to banners and body images.
JPEG, PNG, and GIF are decoded; WebP receives RIFF container, chunk, frame-header,
and dimension validation, not full pixel decoding. A separate local limit of
32,000,000 pixels bounds decoder memory use; this is a tool resource guard,
not a claimed X limit. File extensions must match the detected format.
Authoring guidance points at this section rather than repeating the contract;
the implementation is owned by internal/markdown/image.go.
Markdown payload budget
X’s schema documents a
10,000 weighted-length limit for Markdown entities per article,
but does not publish an Articles-specific weighting algorithm. Conversion uses
a conservative estimate with a local budget of 9,500: NFC-normalized text for
counting, the published X codepoint weights,
separate weights for emoji components, and at least 23 units for each plausible
dotted domain fragment. Other characters are counted normally. The original
Markdown payload is preserved unchanged. This can reject some content X would
accept and is not a guarantee of equivalence to its backend validator. An
over-budget diagnostic reports the estimate and the local budget.
Conversion never silently drops content. Formatting losses produce warnings;
content-loss errors always fail. The command prints diagnostics with source
positions to stderr and fails on warnings by default. Pass
--warnings-as-errors=false to allow warnings while retaining their stderr
reports. Failed conversion does not write an artifact.
The artifact separates the X request from local upload metadata:
{
"payload": {
"title": "Example",
"content_state": { "blocks": [], "entities": [] }
},
"image_locators": []
}
This schematic omits article content. An optional banner_locator sits beside
payload; after media resolution its ID becomes payload.cover_media.
Diagnostics are not serialized. Legacy artifacts with flat title and
content_state fields must be regenerated.
What draft creation does
Draft creation reads the draft artifact conversion emitted. It obtains each
body or banner image’s bytes from the locator the artifact records — resolved
against the recorded post package, refused when the path escapes the post directory or the
bytes’ digest no longer matches — and uploads it. Containment is enforced by
resolving the name through descriptor-anchored directory handles that reject a
symlink escaping the root, so the checked object is the object read and a
swapped symlink cannot redirect it. For body images, the returned media_id lands
on the entity the locator names, not by position. Identical bytes reuse one
identifier within a resolution and, when its lifetime is known, across later
runs through a versioned cache under the task’s ignored output directory.
Persistent reuse is scoped to a one-way fingerprint of the API endpoint, media
category, and all four OAuth credential fields. Changing accounts or rotating
credentials therefore causes a cache miss without an extra identity request.
Unscoped legacy entries are not trusted. The cache contains identifiers,
digests, expiries, and opaque scope fingerprints, never credential values.
Known lifetimes are anchored before the upload request, so upload and processing
time cannot extend them, and reserve 30 seconds for submission. Media that
expires while other files upload is refused before draft creation, including a
later duplicate of an earlier image; it is not uploaded again mid-resolution. Missing or
zero lifetime permits deduplication only within the current resolution; negative
or already unusable lifetimes fail. Banner and body images share the cache, so
identical bytes need only one upload within that resolution.
All referenced files, content digests, and media types are verified before the
first upload; an invalid banner cannot consume an upload or draft request.
Recording the cache is best-effort: a cache that cannot be written costs a later
re-upload rather than failing draft
creation after the uploads already succeeded.
The media uploads happen separately before draft creation. The selected banner’s
uploaded identifier becomes payload.cover_media, sent as the draft request’s
top-level cover_media, with
media_category: "tweet_image" and media_id. Body image identifiers remain
in their DraftJS entities. This follows the
X draft endpoint’s request schema.
An upload without processing_info, or with a succeeded state, needs no
status request. Reported pending or in_progress processing triggers signed
read-only status checks after the server’s check_after_secs, with a minimum
one-second delay and a two-minute default deadline. Failed, unknown, missing,
or inconsistent processing state, partial upload errors, and rejected status
requests stop the operation before the draft POST. Status polling never replays
an upload, and no rejected request is retried automatically.
The uploader creates a draft and reports its article identifier; it never calls
the publish endpoint, so a review in the X composer is always the step that makes
an article public. It does not retry automatically when a request is rejected.
HTTP redirects are returned as failures without following them, preventing a
redirect from issuing another media upload or draft request. The HTTP transport
cannot recreate a consumed POST body for an automatic replay.
Failed requests and retry timing
Every non-2xx API error, including HTTP 503, retains and prints the response’s
X-Rate-Limit-{Limit,Remaining,Reset},
X-User-Limit-24hour-{Limit,Remaining,Reset}, and Retry-After headers.
Only those headers are copied; authorization, cookies, and other response
headers are excluded. The original operation, status, and body remain visible,
including the available body and underlying cause if reading the response fails.
Valid Unix reset values also show their UTC date and time. A
Rate-limit retry not before line appears only when known exhausted windows
(Remaining: 0) have unambiguous future resets. It uses the latest exhausted
window’s reset and extends it with valid later Retry-After advice, either an
HTTP date or seconds after response receipt. Missing, invalid, ambiguous, or
elapsed reset evidence leaves the current retry time unknown. Positive remaining
counts and standalone Retry-After advice do not establish upload eligibility.
The displayed boundary does not guarantee service recovery or request success,
and it never triggers an automatic wait or retry.
Credentials
Draft creation authenticates with OAuth 1.0a user context, whose token does not
expire on the fixed schedule an OAuth 2.0 user token does. It requires four
fields, supplied at run time through the repository’s Vault-backed injection
flow:
X_API_KEYX_API_SECRETX_ACCESS_TOKENX_ACCESS_TOKEN_SECRET
No credential value is recorded in source, and the values are never printed.
The identity, policy, and credential path are owned by
infra/vault/openspec/changes/archive/2026-10-22-add-x-article-uploader-credentials. The credential
sits inside the identity’s own AppRole subtree, the same shape every other
component uses, and BUILD.bazel names its path directly, as every other component’s
injected reference does; the shared AppRole module’s own-subtree policy grants
the read.
Run
Convert a post to a draft artifact:
bazel run //projects/x_article_uploader/cmd/convert -- \
--source projects/alwaldend.com/content/blog/<slug>/index.md \
--out out/x_article_uploader/<slug>.json \
--post-package projects/alwaldend.com/content/blog/<slug>
--post-package may be omitted, in which case the package is derived from the
post directory’s path relative to --workspace (default .). Whether supplied
or derived, the package is opened through a descriptor-anchored handle on the
workspace and the post’s source and images are read through that handle, so the recorded
package and the bytes’ source are the same object: a symlinked post directory
that escapes the workspace, or a supplied package whose opened directory is not
the post directory, is refused instead of recorded; the package is accepted by
comparing the identity of the directory actually opened, not a pathname. The workspace is the caller-supplied
root, never a root rediscovered by walking the filesystem.
Draft creation is the only operation that needs credentials, so run it through
the wrapper that injects them: //projects/x_article_uploader:draft selects
the x_api=1 injection declared in BUILD.bazel, authenticates as the component
AppRole, and places each credential field in its environment variable. The
wrapped command is the draft binary, so its own flags are passed after
--; the binary travels in the target’s data and the config supplies the injector.
Create a draft from a converted artifact:
bazel run //projects/x_article_uploader:draft -- \
--artifact out/x_article_uploader/<slug>.json
Publishing is deliberately unavailable: there is no publish flag and no publish
endpoint call, so a draft becomes public only through a separate review step
outside this tool. The injector only supplies credentials; it does not select
the artifact or publish anything. Do not export X_* values by hand, which
would bypass the AppRole boundary the wrapper establishes.
Checks
bazel test //projects/x_article_uploader/test/e2e:e2e_test
The end-to-end check discovers every post in the site content tree, asserts each
post’s recorded outcome, emits a repeatable draft artifact, and exercises
publication against a recorded-response client. It needs neither credentials
nor network access.
31.1 - OpenSpec
31.1.1 - Specifications
31.1.1.1 - Markdown to draftjs
31.1.1.1.1 - markdown-to-draftjs Specification
Purpose
Compile a Markdown post into the DraftJS content_state document that the X
Articles API accepts, so the Markdown that renders the blog also produces the
article body without hand-editing.
Requirements
Requirement: Source post input model
The converter SHALL treat a blog source post as YAML front matter plus a
Markdown body, and MUST NOT emit front matter as article text. It SHALL expose
the parsed metadata separately from the content_state document, and SHALL
report the parsed title as document metadata because draft creation requires
a title that content_state does not carry. A source whose front matter has no
non-empty title SHALL fail conversion with a diagnostic naming the source,
rather than producing a document that cannot be uploaded.
Scenario: Convert a post with front matter
- WHEN the converter is given a post whose front matter contains a title
- THEN the emitted
content_state contains no front matter text - AND the parsed title is reported as document metadata alongside it
Scenario: Convert a post without a title
- WHEN the source front matter has no non-empty title
- THEN conversion fails with a diagnostic naming the source
- AND it does not emit a document that lacks a usable title
Requirement: Deterministic offline conversion
The converter SHALL transform a Markdown source file into a X-compatible
DraftJS content_state document containing a blocks array and an entities
array of {key, value} entries. Conversion MUST be deterministic and MUST NOT perform network access.
Scenario: Convert a post offline
- WHEN the converter is given a Markdown file
- THEN it emits a
content_state document with blocks and entities - AND it performs no network request during conversion
- WHEN the same Markdown input and configuration are converted twice
- THEN both outputs are byte-identical
Requirement: Articles wire shape
The emitted document SHALL use the exact shape the Articles draft endpoint
accepts, not the canonical DraftJS spelling. Each block SHALL name its ranges
inline_style_ranges and entity_ranges, and MUST NOT carry a depth field,
because the endpoint’s schema sets additionalProperties: false and rejects
both the camelCase range names and any depth. Each entry of entities SHALL
be {"key": "<index>", "value": {"type", "mutability", "data"}}, matching the
endpoint’s schema rather than DraftJS’s inline entityMap.
Scenario: Emit the Articles field names
- WHEN a document with inline styles, links, and a list is converted
- THEN every block names its ranges
inline_style_ranges and entity_ranges
and carries no depth - AND each entity is a
{key, value} entry whose value carries type,
mutability, and data - AND no block or entity field falls outside the schema’s allowed names
Requirement: Heading level mapping
Markdown headings SHALL map onto the two heading block types accepted by the
live Articles draft endpoint. Depth SHALL be clamped: # and ## map to
header-one, and ### and deeper map to header-two. The converter MUST NOT
emit header-three: although the API schema permits it, the live endpoint
returns HTTP 503 for that type.
Scenario: Map a second-level heading
- WHEN a post contains a
## heading - THEN it becomes a
header-one block
Scenario: Map a third-level heading
- WHEN a post contains a
### heading - THEN it becomes a
header-two block
Scenario: Clamp a heading deeper than X supports
- WHEN a post contains a
####, #####, or ###### heading - THEN it becomes a
header-two block - AND no block uses a heading type outside
header-one or header-two
Requirement: Block-level Markdown mapping
The converter SHALL map supported block constructs to the block type X expects:
paragraphs to unstyled, unordered list items to unordered-list-item,
ordered list items to ordered-list-item, and block quotes to blockquote.
Nested list items SHALL be emitted as list items of their own kind rather than
being merged into the parent item.
Scenario: Convert paragraphs and lists
- WHEN a post contains paragraphs and both list kinds
- THEN paragraphs become
unstyled blocks and each item becomes an
unordered-list-item or ordered-list-item block
Scenario: Convert a nested list
- WHEN a list item contains a nested list
- THEN the nested items are emitted as list-item blocks
- AND no item’s text contains the nested list’s raw Markdown
Scenario: Convert a list item with several paragraphs
- WHEN a list item contains more than one paragraph, as a loose list does,
whether or not a block construct such as a nested list or a code block lies
between them
- THEN the item becomes a single list-item block whose text carries all of
the item’s paragraphs
- AND the item’s block constructs follow that block in source order
- AND it does not become one block per paragraph, which DraftJS would read
as separate items and which would renumber an ordered list
Scenario: Convert a block construct nested in a list item
- WHEN a list item contains a block construct such as a fenced code block,
an indented code block, a table, or a thematic break
- THEN the construct is emitted through the same block mapping it uses at
the top level, with its source preserved
- AND its source is not silently dropped by walking only inline children
Scenario: Convert a block quote
- WHEN a post contains a block quote
- THEN it becomes a
blockquote block containing the quoted text
Scenario: Convert a heading inside a block quote
- WHEN a block quote contains a heading, as in
> # Warning, whether
directly or through a nested list as in > - # Warning - THEN the heading text is emitted as a
blockquote block, not an ordinary
heading outside the quote and not a list-item block that drops the quote - AND the lost heading level is reported, because X exposes no quoted-heading
block type
Scenario: Preserve a line break
- WHEN a paragraph contains a soft line break or a hard line break written
with two trailing spaces or a trailing backslash
- THEN the block’s text contains a newline at that break
- AND the two lines are not joined into one word
Requirement: Inline styles and link entities
Inline emphasis SHALL be expressed as inline_style_ranges on the enclosing
block using bold, italic, or strikethrough, with offsets computed against
the block’s final text. Links SHALL become link entities referenced by
entity_ranges on the enclosing block. Ranges MUST be correct when a styled or
linked span is adjacent to other text in the same block.
Offsets SHALL be counted in the code units the DraftJS format uses — UTF-16 code
units of the block’s final text — rather than bytes, runes, or grapheme
clusters. A block containing a supplementary character before a styled or
linked span MUST still select exactly that span, because a byte or rune offset
would select the wrong characters once the document is interpreted as a
JavaScript string.
Scenario: Convert emphasis
- WHEN a paragraph contains bold, italic, or strikethrough text
- THEN the enclosing block carries
inline_style_ranges for that span - AND each range’s offset and length select exactly the styled text
Scenario: Convert a link
- WHEN a paragraph contains a Markdown link
- THEN a
link entity carrying the destination URL is added to entities - AND the enclosing block references it with an
entity_range selecting the link text
Scenario: Convert a link carrying a title
- WHEN a Markdown link carries an optional title, as in
[docs](https://example.test "Reference") - THEN the entity cannot carry the title, so its loss is reported as a
continuing diagnostic naming the title and positioned at the link
- AND the link’s text and destination are still preserved
Scenario: Convert an image carrying a title
- WHEN a Markdown image carries an optional title
- THEN its loss is reported as a continuing diagnostic naming the title and
positioned at the image
- AND the image is still emitted as an
atomic block
Scenario: A titled construct has no text of its own
- WHEN a titled link or image has an empty label or alt text, so the
construct has no text node to locate it
- THEN the lost-title diagnostic is positioned at the construct’s own
opening delimiter rather than at the start of the enclosing block
- AND the reported source position still names the construct that produced
the loss
Scenario: Convert an email autolink
- WHEN a paragraph contains an email autolink such as
<user@example.com> - THEN the
link entity records it as mailto:user@example.com - AND the recorded URL is an email address rather than a relative link
Scenario: A destination carries Markdown escapes or character references
- WHEN a link or image destination escapes a punctuation character or uses a
character reference, as in
[x](https://example.test/a\(1\)?x=1&y=2) - THEN the recorded destination resolves those encodings to the URL the
author wrote
- AND the recorded link or image target does not contain the literal
backslashes or unresolved entity
Scenario: Prose carries Markdown escapes or character references
- WHEN ordinary prose escapes a punctuation character or uses a character
reference, as in
\*literal\* or AT&T - THEN the emitted block text resolves those encodings to the characters the
author wrote rather than keeping the backslashes or the raw entity
- AND a raw span such as a code span keeps its literal source, because its
encoding is its content
- AND an image caption, which is flattened from its inline content, follows
the same rule: resolution applies to each non-raw descendant while a raw span
inside the caption keeps its literal source
Scenario: Keep offsets correct for adjacent spans
- WHEN a block contains multiple styled or linked spans next to plain text
- THEN every range’s offset is measured against the block’s final plain text
- AND no range extends beyond the block text
Scenario: Keep offsets correct after a supplementary character
- WHEN a block contains an emoji or other supplementary character before a styled or linked span
- THEN each range’s offset is measured in UTF-16 code units of the block’s
final text
- AND the range selects exactly the styled or linked text rather than
drifting by the character’s extra code unit
Requirement: Code blocks and tables preserve source Markdown
Code fences and tables SHALL be emitted as atomic blocks backed by a
markdown entity with mutable mutability whose payload preserves the construct’s original Markdown
source. A table MUST NOT be flattened into paragraph text, because X exposes no
table block or entity.
Scenario: Convert a fenced code block
- WHEN a post contains a fenced code block
- THEN it becomes an
atomic block with a markdown entity - AND the entity payload preserves the fenced source, including its language
Scenario: Convert a table
- WHEN a post contains a Markdown table
- THEN it becomes an
atomic block with a markdown entity - AND the entity payload preserves the table as Markdown with its rows and
cell contents intact
Scenario: Convert an indented code block
- WHEN a post contains an indented code block immediately followed by a
non-indented paragraph
- THEN the
markdown entity payload contains only the code block’s own lines - AND the following paragraph is emitted once, as its own block, rather than
being swallowed into the entity and repeated
Scenario: Report the markdown payload budget
- WHEN the documented conservative weighted-length estimate for Markdown
entities exceeds the local per-article budget
- THEN conversion fails with the measured estimate and budget
- AND the diagnostic and documentation distinguish that estimate from X’s
undocumented Articles-specific backend validation
Requirement: Inline code and thematic breaks
DraftJS exposes only bold, italic, and strikethrough as inline styles, so
a Markdown inline-code span has no code style to map onto. Its literal text SHALL
survive conversion unchanged, and the loss of the monospace styling SHALL be
reported as a conversion diagnostic so the author sees it rather than having it
silently dropped. A Markdown thematic break SHALL become an atomic block
backed by a divider entity, because X exposes divider for exactly that
purpose, rather than being dropped as an unrecognized paragraph.
Scenario: Convert an inline-code span
- WHEN a post contains a Markdown inline-code span
- THEN the block’s final text contains the span’s literal text
- AND conversion reports the lost code styling as a diagnostic
Scenario: Convert a GFM task-list item
- WHEN a post contains a task-list item
- THEN the item’s text keeps an indicator of its checkbox state
- AND the checked state is not silently dropped
Scenario: Convert a thematic break
- WHEN a post contains a thematic break
- THEN it becomes an
atomic block with a divider entity - AND it does not become paragraph text containing the break’s characters
DraftJS has no footnote construct, so footnote definitions SHALL be preserved in
a trailing Footnotes section rather than dropped. Each in-text footnote
reference SHALL become plain bracketed text, and each definition SHALL become an
ordered-list-item beneath a Footnotes heading.
- WHEN a post contains a footnote reference and its definition
- THEN the reference appears in the body as plain bracketed text
- AND a
Footnotes heading is appended with each definition as an
ordered list item
- WHEN a footnote definition contains multiple paragraphs or inline
formatting such as a link
- THEN each definition paragraph becomes its own ordered list item rather
than being joined without a separator
- AND inline entities such as links are preserved by the normal inline
mapper rather than flattened to plain text
- WHEN a footnote definition contains a nested list, block quote, fenced or
indented code block, table, or thematic break
- THEN the construct is emitted through the block mapper with its content
preserved
- AND it is not silently dropped
- WHEN a post contains no footnotes
- THEN no
Footnotes heading is added
The image entity SHALL carry its media as media_items, whose entries require
a media_category and a media_id; data.url is documented for link
entities and MUST NOT be treated as an image source. Each explicit body image
SHALL become an atomic block plus an image entity, and unresolved images SHALL remain
explicitly unresolved so publication can resolve or reject them rather than
silently emitting a broken article. Because the media endpoints accept only a
fixed set of image media types that excludes image/svg+xml, the converter
SHALL report an image whose media type the upload endpoints cannot accept, with
its source position, rather than emitting an entity that publication can never
resolve. The declared extension SHALL be accepted as the media type only when
the file’s bytes carry that format’s own signature, so a file renamed to an
accepted raster extension — even one accepted format renamed to another — is
reported rather than sent to the upload endpoint.
Scenario: Convert an inline image
- WHEN a post contains an explicit Markdown image with alt text
- THEN it becomes an
atomic block with an image entity - AND the entity preserves the alt text as its caption, resolving Markdown
escapes and character references the way prose is resolved while a raw span
inside the alt text keeps its literal source
Scenario: Publication has not yet resolved an image
- WHEN a converted document references an image whose media has not been uploaded
- THEN the unresolved image is distinguishable from a resolved one
- AND publication refuses to send an unresolved image as though it were resolved
Scenario: An image cannot be uploaded
- WHEN a post references an image whose media type the media upload endpoints do not accept
- THEN the converter reports the image with its source position
- AND it does not emit an entity that publication could never resolve
Scenario: An image reference resolves outside the post directory
- WHEN a post’s image reference is a syntactically safe relative path whose
canonical target lies outside the post’s directory, such as a symlink to a
file elsewhere
- THEN the converter reports the image with its source position rather than
reading bytes outside the post boundary
- AND it does not record a locator that publication would later reject, so a
converted artifact remains publishable
Scenario: Image bytes do not match the declared extension
- WHEN a post references an image whose bytes are not the format its extension declares
- THEN the converter reports the image with its source position instead of treating it as the declared type
- AND it does not emit an entity the upload endpoint would reject
- WHEN bytes of one accepted raster format carry the extension of a different accepted raster format
- THEN the converter reports the mismatch rather than accepting the sniffed type
- AND it does not fall back to another accepted media type
Scenario: An image reference requires Markdown escaping
- WHEN a local image reference names a file whose name needs Markdown
escaping, as in
.png) - THEN the reference is resolved before filesystem lookup, so the file it
names is read rather than reported unreadable
- AND the recorded locator names the resolved path
Scenario: A symlink’s target has a different extension than the reference
- WHEN an image reference such as
image.png is an in-directory symlink to a
file with a different raster extension, such as actual.webp - THEN the declared-extension check classifies the image by the reference the
author wrote, not by the canonical target’s name
- AND bytes that do not match the reference’s declared format are reported
rather than accepted through the target’s extension
Scenario: An inline image splits a styled span
- WHEN an inline image interrupts a styled or linked span
- THEN the text before the image keeps its style or entity range
- AND the text after the image keeps its style or entity range
Scenario: A link wraps only an image
- WHEN a Markdown image is the entire content of a link, as in
[](target) - THEN the image is still emitted as an
atomic block with its image
entity - AND the lost destination is reported as a continuing diagnostic naming the
link target, because the link has no text span to carry it
Scenario: A link wraps an image inside an inline wrapper
- WHEN the link’s only content is an image nested inside a style wrapper,
as in
[****](target) - THEN the enclosing link is found by ancestry rather than by immediate
parentage
- AND the lost destination is still reported, because the link has no text
outside the image
Scenario: A link carries text beside an image
- WHEN a link contains non-whitespace text of its own in addition to an
image, as in
[label ](target) - THEN the destination survives as a
link entity over that text - AND the image, which still cannot carry the link, is reported as a
continuing diagnostic naming the destination, so the partial loss is not
hidden merely because sibling text kept the link
Scenario: A post follows the raster-only policy
- WHEN a post’s images all use a media type the media upload endpoints accept
- THEN conversion completes with an
image entity for each explicit body image - AND no unacceptable-image diagnostic is reported for that post
Requirement: Artifact carries image locators
Because the API’s entity data object rejects additional properties, an image’s
source cannot travel inside the entity. The emitted draft artifact SHALL
therefore carry, as metadata beside content_state, an entry for every
unresolved image. Each entry SHALL name the image’s source path relative to the
post’s directory, SHALL record the post package the path is relative to, and
SHALL record a digest of the image bytes as they were at conversion time, so the
artifact identifies both the image and the directory it resolves against.
Publication SHALL be able to obtain the image bytes from the artifact alone,
without re-parsing Markdown, and SHALL reject a locator that escapes the post’s
directory or whose current bytes do not match the recorded digest. Conversion
SHALL apply the same containment before it reads an image, so it neither
inspects bytes outside the post boundary nor records a locator that publication
would refuse. Both SHALL enforce containment by resolving the name through
descriptor-anchored directory handles that reject a symlink escaping the root,
rather than by checking a pathname and then re-opening it, so the object whose
containment is checked is the object read.
Scenario: Convert an image into the artifact
- WHEN a post containing a raster image is converted
- THEN the artifact carries a locator entry for that image beside the document
- AND the entry names the source path relative to the post’s directory, the
post package the path resolves against, and a digest of the image bytes
Scenario: Associate a locator with its image entity
- WHEN an artifact carries two or more image locators
- THEN each locator entry records the entity it resolves, by the entity’s
key, so the mapping does not depend on ordering or on repeated captions
- AND publication attaches each returned
media_id to the entity its locator
names rather than by position
Scenario: Convert a source given by an absolute path
- WHEN the conversion command is given an absolute
--source and no
--post-package - THEN the recorded locator’s package is relative to the workspace named by
--workspace, rather than the absolute source directory - AND the artifact remains publishable, because publication refuses an
absolute package rather than resolving it
- AND the workspace root is the caller-supplied
--workspace value and is
never re-discovered by walking the filesystem, so no repository marker found
through a link can be mistaken for it
Scenario: A post directory is reached through a symlink
- WHEN the derived package would name a post directory whose canonical
target, after resolving symlinks, lies outside the workspace root
- THEN the conversion is refused with a directive to pass
--post-package
explicitly, rather than recording a package the descriptor-anchored read
would resolve past and reject - AND an in-workspace symlink still records the relative package of the
canonical directory it resolves to, so the recorded package matches the
object publication reads
- AND a link that points directly at another checkout’s root, a link into
another tree beneath its root, and a post directory reached through an
intermediate symlink-component are all refused rather than recorded relative
to the external tree or collapsed to
. - AND containment is established by opening the directory through a
descriptor-anchored handle on the workspace, so the no-symlink validation and
the directory accepted for the package are the same traversal and cannot be
separated by a writer swapping the directory for a link
- AND image reads for the post go through that same handle rather than
re-opening the source pathname, so a symlink retargeted after validation
cannot make conversion read another tree’s bytes while the artifact still
records the validated package
Scenario: A post package is supplied explicitly
- WHEN the conversion command is given
--post-package rather than having
one derived - THEN the package is accepted only when the directory it opens to is the
post directory, compared by file identity rather than by pathname, because
publication resolves the locator paths against the package and a package
naming another directory would make publication read a different object than
conversion did
- AND the post’s images are read through the descriptor-anchored handle the
identity was checked on, so a package retargeted between the check and the
read cannot supply another tree’s bytes while the locator still names the
supplied package
- AND an absolute package, a package that escapes the workspace, or a
package naming a different directory than the post is refused
Scenario: Resolve an image from the artifact
- WHEN publication reads an unresolved image from the artifact
- THEN it obtains the image bytes from the recorded locator without
re-parsing the source Markdown
- AND it resolves the relative path against the recorded post package even
when the artifact was moved elsewhere
- AND it refuses a locator that escapes the post’s directory or names bytes
whose digest does not match the recorded one
Scenario: A symlink changes after containment validation
- WHEN a locator’s path or its target is swapped for a symlink that leaves the
post directory after containment was established
- THEN the read is refused rather than following the swapped symlink
- AND a swapped symlink cannot redirect the read to a different file, because
the containment check and the read operate on the same descriptor rather than
on a re-opened pathname
Requirement: Conversion diagnostics
The converter SHALL report a construct it cannot represent with the source
location that produced it. It SHALL distinguish two outcomes and never emit a
document that silently omits content it could not represent: a construct whose
content is preserved but whose formatting is lost is reported as a warning.
The conversion command SHALL fail on warnings by default and SHALL permit them
only with --warnings-as-errors=false. Errors SHALL fail with either setting.
All diagnostics SHALL be printed to stderr and SHALL NOT appear in artifact JSON. The
image whose media type the upload endpoints reject and the source without a
title are failing outcomes; an inline-code span’s lost styling is a continuing
one.
Scenario: Encounter an unsupported construct
- WHEN the converter cannot represent a construct and its content would be lost
- THEN it reports the construct with its source position
- AND conversion fails rather than emitting a document that discards the content
Scenario: Report continuing losses when conversion also fails
- WHEN a source contains both a continuing loss and a failing construct, such
as an inline-code span and an unacceptable image
- THEN the continuing diagnostic is reported alongside the failing one
rather than being discarded with the returned error
- AND the author sees every detected loss in one run
- WHEN the converter preserves a construct’s content but cannot reproduce its formatting
- THEN it reports the lost formatting with its source position
- AND command conversion fails by default without writing an artifact
- AND
--warnings-as-errors=false permits completion with the content present
while still reporting the warning to stderr
Scenario: Report a position after a multi-byte character
- WHEN a diagnostic’s construct follows a multi-byte character on the same
line
- THEN the reported column counts source characters rather than bytes, so it
names the position an editor shows
- AND the byte offset is still recorded for slicing the source
The converted artifact SHALL put title and content_state inside payload. Body
image locators and the optional banner locator SHALL remain outside payload.
Diagnostics SHALL NOT be serialized. Media resolution SHALL attach body media
IDs inside payload.content_state and the banner ID inside payload.cover_media.
Artifact reading SHALL reject the old flat format and require regeneration.
Scenario: Build an offline artifact
- WHEN conversion succeeds
- THEN payload contains title and content_state in the X request shape
- AND local media references remain alongside payload
- AND there is no serialized diagnostics field
- WHEN the uploader resolves an artifact’s media
- THEN body entities inside payload receive media_items
- AND the banner becomes payload.cover_media
- AND the draft request contains only X payload fields
Scenario: Read a legacy flat artifact
- WHEN an artifact has title and content_state outside payload
- THEN reading fails before any API request
- AND the error instructs the caller to regenerate the artifact
Requirement: Validate the supported static image contract
Conversion and draft preflight SHALL accept only static JPEG, PNG, GIF, and
WebP images up to 5,000,000 bytes. They SHALL reject unsupported formats,
animations, malformed images detectable by the supported decoder or container
validator, and images exceeding the documented local decoded-size guard. The
implementation SHALL distinguish X’s upload limits from local resource guards
and SHALL NOT claim full WebP decoding when only container/header validation is
available. Every image SHALL pass preflight before any upload or draft request.
Scenario: An unsupported or animated image is referenced
- WHEN a banner or retained body image uses an unsupported format or animation
- THEN conversion reports the unusable source
- AND a supplied artifact containing that source is also refused before network requests
Scenario: A file exceeds the simple-image upload limit
- WHEN a selected image contains more than 5,000,000 bytes
- THEN conversion and draft preflight refuse it before upload
- WHEN a file’s signature matches its extension but decoding or container validation fails
- THEN it is refused rather than sent as a usable image
Requirement: Independent banner and body image conversion
The converter SHALL resolve the first entry of the optional front matter
images array as the article banner. It SHALL record a separate banner locator
with the post-relative path, post package, content digest, and detected media
type, using the same image validation as body images. Banner metadata MUST NOT
insert or remove any body image blocks, entities, or locators. The converter
SHALL preserve every valid explicit Markdown image in source order, including
opening images, repeated references, and images whose bytes match the banner.
Malformed metadata or an unusable selected image SHALL fail conversion. Banner
selection MUST NOT bypass body image containment or media validation.
Scenario: Select a banner independently of body images
- WHEN a post selects a local image in the first
images entry - THEN conversion records its banner locator separately from body locators
- AND later
images entries do not select additional banners - AND body text and images retain their original order
Scenario: Preserve an opening image that matches the banner
- WHEN a post opens with explicit Markdown images whose validated bytes
match its selected banner, in one or several paragraphs
- THEN every occurrence produces its normal body block, entity, and locator
- AND the separate banner locator remains present
Scenario: Keep metadata-only images out of the body
- WHEN a post selects a banner in
images and contains no Markdown images - THEN conversion records the banner locator
- AND it creates no body image blocks, entities, or locators from metadata
Scenario: Preserve a secondary front matter image
- WHEN a body image also appears in a later
images entry - THEN the explicit Markdown image remains in the body
- AND that metadata entry creates no additional banner or body occurrence
Scenario: Convert without a selected banner
- WHEN
images is absent or empty - THEN the artifact has no banner locator and preserves existing conversion behavior
Scenario: Refuse an invalid selected banner
- WHEN
images is not an array of strings, or its selected image is missing,
unsupported, remote, or outside the post package - THEN conversion fails with a diagnostic before any network operation
Scenario: Validate a body image that aliases the banner
- WHEN a body image aliases the banner’s bytes through an escaping symlink
or an unsupported media type
- THEN normal conversion diagnostics refuse that body reference
- AND matching bytes do not bypass validation
31.1.1.2 - X article publication
31.1.1.2.1 - x-article-publication Specification
Purpose
Create an X Article draft from a converted Markdown post, resolving referenced
images through the media upload endpoint. The uploader creates drafts only; it
never publishes an article.
Requirements
Requirement: Authenticated requests to X Articles
The publisher SHALL authenticate to the X API with credentials supplied at run
time through the repository’s secret-injection flow. Credential values MUST NOT
be recorded in source, committed configuration, logs, or command history.
Authentication SHALL use OAuth 1.0a user context, because the existing media and
Articles endpoints accept it and its user-context token does not expire on a
fixed schedule the way an OAuth 2.0 user token does, so draft creation does not
depend on a rotating refresh token. OAuth 1.0a needs four credential fields —
the API key, the API secret, the access token, and the access token secret —
and the publisher SHALL sign each request with HMAC-SHA1 per RFC 5849 using the
repository’s standard library rather than adding a signing dependency. The
publisher SHALL fail when any of the four fields is absent, rather than sending
a partially signed request.
Scenario: Create a draft with injected credentials
- WHEN the publisher runs with credentials supplied through the injection flow
- THEN it signs its requests to the X API with OAuth 1.0a user context
- AND it does not print the credential values
Scenario: Credentials are unavailable
- WHEN the publisher runs without any one of the four required credential fields
- THEN it fails with a diagnostic naming the missing credential reference
- AND it does not retry with a partial or empty credential
Requirement: Draft-only uploads
The uploader SHALL create X Article drafts and MUST NOT publish an article. It
SHALL NOT call the Articles publish endpoint or expose a way to request
publication, so no invocation of this tool can make a post publicly visible.
Draft creation SHALL send the title that conversion parsed from the source front
matter, and MUST NOT invent, default, or omit it, because the draft endpoint
requires a title that content_state does not carry.
Scenario: Create a draft
- WHEN draft creation is requested for a converted document
- THEN the publisher reads the draft article identifier from the v2 response envelope’s
data.id - AND no post becomes publicly visible
- AND the request carries the title parsed from the source front matter
Scenario: A draft response omits the identifier
- WHEN the draft endpoint returns a 2xx response whose
data.id is missing or empty - THEN the publisher fails rather than reporting a successful draft with no identifier to review
- AND it does not treat the zero-value response as a created draft
Scenario: Draft creation is requested without a parsed title
- WHEN draft creation is requested for a document with no parsed title
- THEN the publisher fails with a diagnostic
- AND it does not send a placeholder or empty title
The publisher SHALL upload each referenced image through the X media upload
endpoint and reference the returned media_id in an image entity, because
that entity carries no document URL. Uploading MUST happen before the draft
that references the media is created.
The publisher SHALL obtain the image bytes from the locator the draft artifact
records beside the document, not by re-parsing the source Markdown, because the
API’s entity data object rejects additional properties and so cannot carry a
path. It SHALL resolve the recorded relative path against the post package the
locator records, so the artifact stays resolvable after it is moved. It SHALL
reject a locator that escapes the post’s directory or whose bytes do not match
the digest the locator records, rather than uploading a different image. It
SHALL enforce that containment by resolving the name through a
descriptor-anchored directory handle that rejects a symlink escaping the root,
rather than by checking a pathname and then re-opening it, so the object whose
containment is checked is the object read.
- WHEN a converted document references an unuploaded image
- THEN the publisher reads the image bytes from the artifact’s locator and
obtains a
media_id - AND the created draft references that
media_id in its image entity
Scenario: Reuse an already uploaded image
- WHEN the same image content has a ready upload in the current credential context and a usable lifetime
- THEN the publisher reuses the recorded
media_id rather than uploading the
same bytes again
Scenario: Reuse an upload in a later run
- WHEN draft creation runs again in a new process for an image this tool already uploaded
- THEN it reuses the identifier only when the cache schema, endpoint, media category,
credential context, content digest, and conservative expiry all match
- AND it stays correct when the cache is absent or the recorded digest no
longer matches the artifact’s, by uploading again rather than reusing a stale
identifier
- WHEN the media upload endpoint returns the v2 response envelope
- THEN the publisher reads the media identifier from the envelope’s
data.id - AND the created draft references that identifier rather than an empty one
- WHEN the media upload endpoint returns a 2xx response whose
data.id is missing or empty - THEN the publisher fails rather than resolving the image to an empty identifier
- AND it does not send an entity that references a missing media identifier
Scenario: Expire a cached upload
- WHEN the recorded lifetime of a cached media identifier has passed before image resolution begins
- THEN the cached entry is treated as a miss and the image is uploaded again
- AND an entry with enough lifetime for draft submission is still reused
Scenario: An image cannot be uploaded
- WHEN an image upload fails
- THEN the publisher fails and reports the failing image
- AND it does not create a draft that references a missing or placeholder media identifier
Scenario: An artifact names an unusable image locator
- WHEN an artifact’s locator escapes the recorded post package or names bytes whose digest does not match the recorded one
- THEN the publisher fails with a diagnostic naming the locator
- AND it uploads no replacement image in its place
Scenario: An unresolved image entity has no locator
- WHEN an artifact retains an
image entity without media_items but records no locator that resolves it - THEN the publisher fails before uploading any image or creating a draft, naming the unresolved entity
- AND it does not send an image entity without a media item
Scenario: A locator does not name a distinct image entity
- WHEN an artifact’s locator names an entity that is missing, is not an image, or is already named by another locator
- THEN the publisher fails before uploading any image rather than discovering the mismatch after paying for uploads
Scenario: Two entities share one numeric key
- WHEN an artifact contains more than one entity with the same numeric key
- THEN the publisher fails before uploading any image, because one locator could resolve only the first and leave the other without
media_items
Scenario: An image entity carries a malformed media_items entry
- WHEN an image entity’s
media_items is present but its entry has an empty or absent media_id, or a missing or incorrect media_category - THEN the entity is treated as unresolved, so the publisher requires a locator rather than sending the invalid entry to X
Scenario: An image entity carries a usable entry beside a malformed one
- WHEN an image entity’s
media_items holds a usable entry next to an empty, non-object, or incorrectly categorized one - THEN the entity is treated as unresolved, because every supplied entry must be usable
- AND the publisher does not send the malformed array merely because one entry looked valid
Scenario: An image entity carries no usable key
- WHEN an artifact contains an image entity whose
key is missing, non-numeric, fractional, or negative - THEN the publisher fails before uploading any image, because the entity is invisible to locator coverage
- AND it does not send an unresolved image to X
Scenario: The cache cannot be written
- WHEN the cache cannot be recorded, such as a cache path in a read-only directory or over an existing directory
- THEN draft creation continues and the draft is created from the uploads that already succeeded
- AND the failure costs a later re-upload rather than aborting draft creation
Requirement: Reporting and failure handling
The publisher SHALL report the identifier it obtained and SHALL fail loudly
rather than report success when a request was rejected. Failures MUST identify
which operation failed and MUST NOT be retried automatically.
For every non-2xx API response, including HTTP 503, the error SHALL preserve and
display the original operation, status, body, and only these response headers:
X-Rate-Limit-Limit, X-Rate-Limit-Remaining, X-Rate-Limit-Reset,
X-User-Limit-24hour-Limit, X-User-Limit-24hour-Remaining,
X-User-Limit-24hour-Reset, and Retry-After. It SHALL preserve every value of
those headers and SHALL NOT copy authorization, cookies, or other headers into
the error. A rejected response whose body cannot be completely read SHALL
retain its status and headers alongside the body-read error cause.
Valid Unix reset timestamps SHALL also be displayed as human-readable UTC.
A combined rate-limit retry not-before boundary SHALL be reported only when
known exhausted windows have valid, future reset times at response receipt.
A window SHALL count as exhausted only when its unambiguous remaining value
is zero. The boundary SHALL use the latest reset among those windows, extended
by a valid later Retry-After value interpreted as decimal seconds from receipt
or an HTTP date. Missing, malformed, ambiguous, or already-elapsed reset data
for an exhausted window SHALL prevent a combined boundary. A positive remaining
count or Retry-After alone MUST NOT imply upload eligibility. The diagnostic
SHALL distinguish a not-before boundary from guaranteed service recovery or
request success, and SHALL preserve raw values when timing is unknown.
Scenario: Report the created identifier
- WHEN a draft is created
- THEN the publisher reports the draft’s article identifier
Scenario: The API rejects a request
- WHEN an API request is rejected
- THEN the publisher reports the failing operation and the API’s error
- AND it does not report the operation as successful or retry automatically
Scenario: Service unavailable with remaining allowance
- WHEN a 503 response includes remaining allowance and reset headers
- THEN the error retains those headers and displays readable UTC resets
- AND it does not claim that the resets guarantee service recovery
Scenario: Both rate windows are exhausted
- WHEN both remaining counts are zero and both resets are valid future times
- THEN the rate-limit boundary is no earlier than the later reset
- AND valid later Retry-After advice extends that boundary
Scenario: Timing evidence is incomplete or invalid
- WHEN an exhausted window has a missing, malformed, ambiguous, or elapsed reset
- THEN the diagnostic reports that a current retry time is unknown
- AND it keeps the original header values without inventing an exact time
Scenario: A rejected response body is truncated
- WHEN a non-2xx response terminates before its declared body length
- THEN the error retains the operation, status, partial body, and allowlisted headers
- AND callers can still inspect the body-read error cause
Scenario: Validation runs without network access
- WHEN the project’s checks validate conversion
- THEN they run without contacting the X API
- AND no test requires live credentials
Requirement: Article banner media
Draft creation SHALL upload a selected banner through the media API and send
its identifier in the optional cover_media object with
media_category: tweet_image. The publisher SHALL share its digest-based media
cache between banner and body images, reusing an unexpired identifier for the
same bytes. It SHALL validate all banner and body image locators, bytes,
digests, and media types before any upload or draft request.
Scenario: Reuse one upload for banner and body
- WHEN the banner and a body image contain the same bytes
- THEN at most one media upload resolves both references
- AND the draft request carries that ID in
cover_media and the body entity
Scenario: Upload distinct banner and body images
- WHEN the selected banner has different bytes from every body image
- THEN it receives its own media upload or cached identifier
- AND all media resolves before the draft request is sent
Scenario: Create a draft without a banner
- WHEN the artifact has no banner locator
- THEN the request omits
cover_media
Scenario: Invalid image prevents every request
- WHEN any banner or body locator is malformed, escapes its package, names
missing bytes, or has a mismatched digest or media type
- THEN draft creation fails before any media or draft HTTP request
The publisher SHALL inspect media processing information before using an upload
identifier. A response without processing information or with succeeded state
SHALL require no status request. Pending or in-progress processing SHALL use
read-only signed status requests, respect the reported delay, and stop within a
bounded deadline. Failed, unknown, inconsistent, or incomplete processing state,
partial upload errors, and rejected status requests SHALL prevent draft creation.
Neither upload nor draft POST requests SHALL be replayed by this workflow.
- WHEN upload succeeds without processing information or with succeeded state
- THEN the publisher makes no processing-status request
- AND the media identifier can be attached to the draft
Scenario: Media processing remains pending
- WHEN the upload reports pending or in-progress processing
- THEN the publisher checks status after the prescribed delay within a finite budget
- AND it creates a draft only after observing succeeded state
- WHEN processing fails, exceeds its deadline, returns errors, or supplies inconsistent state
- THEN the publisher reports the media failure without creating a draft
- AND it does not retry the upload POST
Persistent media reuse SHALL be scoped to the upload endpoint, media category,
and OAuth credential context without persisting plaintext credentials or
requesting account identity merely to name the cache. Changing any credential
field SHALL prevent reuse from the prior context. Unscoped legacy entries SHALL
be treated as misses.
A persisted entry SHALL have a known positive lifetime, conservatively anchored
before upload and accounting for processing time and a submission reserve.
Missing or zero lifetime SHALL permit reuse only within the current resolution,
never across resolutions or processes. Negative or already unusable upload
lifetimes SHALL fail before draft creation.
Scenario: A token or account changes
- WHEN identical image bytes are submitted using a different credential context
- THEN the earlier context’s cached identifier is not reused
- AND the cache contains no credential values
Scenario: A response provides no known lifetime
- WHEN an upload response omits its lifetime or reports zero
- THEN identical banner and body images may share that fresh identifier within one resolution
- AND a later resolution uploads the bytes again
Scenario: Uploading or processing consumes the usable lifetime
- WHEN a positive reported lifetime has insufficient time remaining for submission
- THEN draft creation stops instead of attaching the expired or near-expiry identifier
Scenario: An earlier image expires before its later duplicate is resolved
- WHEN uploading another image consumes the usable lifetime of an identifier already selected for a banner or body image
- AND a later body image references those same bytes
- THEN resolution stops without uploading the duplicate again or creating a draft
- AND a replacement cache entry cannot mask the expired identifier already selected for the draft
31.1.1.3 - X article uploader build
31.1.1.3.1 - x-article-uploader-build Specification
Purpose
Build the X Article uploader from pinned, hermetic inputs so conversion and its
tests run reproducibly in the repository’s Bazel workflow without network access
or credentials.
Requirements
Requirement: Bazel targets for the uploader
The project SHALL expose Bazel targets for its converter library, its
conversion command, and its draft-creation command, with tests declared beside
the sources they cover. Targets MUST follow the repository’s role-based source
layout using internal/ for implementation and cmd/ for entry points.
Scenario: Build the converter and draft command
- WHEN the project’s conversion and draft-creation targets are built
- THEN both binaries build from the project’s declared sources
Scenario: Test the converter
- WHEN the project’s library tests run
- THEN they execute against the converter’s declared source inputs
- AND they require neither credentials nor network access
Requirement: Pinned hermetic dependencies
External build inputs, including the Markdown parser, SHALL be declared with
immutable versions and integrity information in the owning dependency
declarations, and SHALL be updated through the owning generator rather than
hand-edited.
Scenario: Add a Markdown parser dependency
- WHEN the project depends on an external Markdown parser
- THEN its version and integrity are pinned in the owning dependency declaration
- AND the applicable lock and package-check targets validate the declaration
Scenario: Build without network access
- WHEN the project is built and tested in the repository’s agent configuration
- THEN no build or test step fetches an undeclared input
Requirement: Behavioral tests over real posts
Tests SHALL exercise conversion against every blog post in the site content
tree and SHALL assert the mapped block types, inline ranges, and entity payloads
for the constructs those posts contain, rather than relying on a single smoke
check. The covered set MUST be derived from the content tree, so a post added
later is covered without editing the test list. Each post SHALL carry an
expected outcome: a post whose images all use a media type the upload endpoints
accept MUST satisfy the mapping contract and MAY carry the continuing
diagnostics its constructs produce, while a post that references an unacceptable
image MUST fail with the named diagnostic at the reported source position. Where
a construct is not present in any current post, a focused case SHALL cover it.
Behavior coverage SHALL be authored before the implementation it exercises: the
expected outcome for a construct, or the enumerated ways a conversion can fail,
is written first, and the implementation follows. Test cases MUST assert
observable conversion behavior and MUST NOT restate the implementation’s own
constants or assert only that output changed.
Scenario: Convert every existing blog post
- WHEN the converter’s tests run against the blog posts in the site content tree
- THEN conversion is exercised for every post in the tree, discovered from the tree itself
- AND each post produces the outcome its entry records: the mapping
contract where every image is acceptable, including any continuing diagnostic
its constructs produce, or the named failing diagnostic where an image is not
acceptable
Scenario: Cover a construct absent from any current post
- WHEN a mapped construct does not appear in any current post
- THEN a focused case covers that construct
- AND the case asserts the resulting block type and range offsets
Scenario: Author behavior coverage before implementation
- WHEN a conversion behavior is implemented
- THEN the case that establishes its expected outcome already exists
Requirement: Raster diagram renders for posts intended for a draft
A post intended for a draft SHALL reference only images whose media type the
upload endpoints accept. A Mermaid diagram in such a post SHALL be referenced as
a raster render of its .mmd source, and this change SHALL verify that render
with an end-to-end check. The check SHALL prove the properties this project
depends on: the produced image is in an accepted media type, it was rendered
from the diagram source through the repository’s maintained Mermaid render
contract rather than a host browser, a host font, a CDN fetch, or a second
appearance, and the post that references it converts without an
unacceptable-image diagnostic.
Scenario: Convert a post that references a rendered diagram
- WHEN a post intended for a draft references a diagram’s raster render
- THEN the conversion check reads that rendered image from the post’s package
- AND the image is in a media type the upload endpoints accept
- AND the post’s recorded outcome is the mapping contract, with no
unacceptable-image diagnostic
Scenario: Render a diagram hermetically as a raster image
- WHEN the raster render referenced by that post is produced
- THEN it is rendered from the diagram source through the pinned Mermaid
inputs and the maintained appearance, not a host browser, a host font, a CDN
fetch, or a second appearance
Requirement: Project registration
The new project SHALL be registered everywhere the repository catalogs direct
projects, so the project builds, tests, and validates like its siblings.
Scenario: Register the project
- WHEN the project is added under
projects/ - THEN it appears in the project catalog, the OpenSpec validation workspace
sources, and its own OpenSpec workspace
Scenario: Validate the repository
- WHEN the repository’s OpenSpec validation runs
- THEN the new owner workspace is included and its artifacts validate strictly
Requirement: Project documentation
The project SHALL document its purpose, its two operations, its inputs and
outputs, how to run conversion and publication, and the credential and
disclosure boundary it depends on.
Scenario: Read the project documentation
- WHEN a reader opens the project README
- THEN it explains conversion and publication, their inputs and outputs, and
how credentials are supplied
- AND it states that conversion is offline and publication is the only
authenticated, network-performing operation
32 - X profile cleaner
CLI and local browser interface for Lua-configured X profile cleanup
X profile cleaner


Posts and reposts use separate workers and quota buckets. Resume keeps the
confirmed selection and skips completed actions within the same server session.
This Go CLI prepares and applies Lua-configured cleanup of an authenticated
X account’s posts, replies, quote posts, and repost actions. Planning never
deletes content. Lua configuration registers predicates and preservation
requests; Go owns collection, graph traversal, and execution. internal/planner consumes
plain rule descriptions and exchanges plain callback values with an evaluator.
internal/policy owns the Lua interpreter and callback registry; interpreter
values never enter the planner.
Mandatory safety rules
The maintained safety requirements
are hard constraints:
- Planning never mutates the X profile, even for forced deletions. It only
reads API data and writes the requested plan output.
- Policy selection is exact: delete only when explicitly forced, or when
ordinary deletion selects an item which is not preserved. Unselected items
stay unchanged. Errors fail planning rather than broaden deletion.
- The generated plan is the complete selected action list, with the correct
account, operation kinds, target IDs, and forced indicators. Repost removal
targets the repost relationship rather than deleting its source content.
- Apply executes only that list. It validates the entire plan and account
first, adds no actions, performs no deletion cascade, and does not rerun Lua.
Independent endpoint workers preserve order within each endpoint and between
actions on the same target. A failure cancels outstanding work and stops further
dispatch; requests already accepted by X may still complete.
These rules specify behavior for the supplied policy and collected snapshot;
they cannot determine intent which is not expressed in that policy. Review
the generated plan before applying it. Historical discovery limits remain
documented below.
Policy
Start with examples/policy.lua:
local function older_than_30_days(item)
return item.age_days > 30
end
delete_post_when(older_than_30_days)
delete_repost_when(older_than_30_days)
The post predicate includes all your replies, including replies to other
accounts. Foreign content is ignored, never deleted, and never connects own
graph branches. Reposts are your own activities: their age is time since your
repost, and execution removes that relationship rather than its source post.
Articles and Highlights-specific handling are outside scope.
For chunked runs, set an optional discovery window at the top of the policy:
set_time_window("2024-01-01T00:00:00Z", "2024-02-01T00:00:00Z")
For a rolling period, use set_time_window(days_ago(90), days_ago(30)).
days_ago accepts finite nonnegative fractional days and returns a whole-second
UTC timestamp based on the same fixed evaluation time as age_days. It performs
no inventory read. Unsupported timestamp ranges fail planning.
The start is inclusive and the end exclusive, so adjacent periods do not
overlap. Either bound may be nil: use
set_time_window(nil, "2024-02-01T00:00:00Z") for an end-only window or
set_time_window("2024-01-01T00:00:00Z", nil) for a start-only window.
Omitting the function or both bounds leaves discovery unbounded. Bounds must
be RFC3339 timestamp strings at whole seconds, on or after 2010-11-06; offsets
are normalized to UTC. Set the window before any query or nonempty direct
selection loads inventory. It can be revised before that first read, but not
inside callbacks or after data has loaded.
Every timeline page carries the same bounds. All Lua queries, graph traversal,
and deletion candidates use the resulting window; the CLI makes no unbounded
fallback request to retrieve missing context. Even forced deletions cannot
select an activity absent from that inventory. See the
discovery boundary for the effect on thread preservation.
preserve_post(id) preserves the selected post and recursively its own reply
descendants. preserve_thread(id) follows all later quote branches and walks
own reply chains in both directions. If a reply to your post1 quotes post2,
preserving the post2 thread also preserves that reply, post1, and their
reachable reply/quote branches. It never walks back to a quoted ancestor.
Repost preservation uses
preserve_repost(activity_id); source post IDs remain separate.
Direct deletion and preservation functions accept one ID string or a dense
array of ID strings, for example preserve_post({"111", "222"}). Empty arrays
do nothing. The complete array is validated before any request from that call
is registered. Each entry has the same behavior and callbacks as an individual
call. The example keeps editable ID arrays together at the top of the file.
Every preservation function also has a _when(predicate) form. It accepts an
optional inclusion function, or a table with include_post and follow_edge:
preserve_thread("1111111111111111111", {
include_post = function(post)
return not post.is_reply or (post.metrics.like_count or 0) >= 10
end,
follow_edge = function(edge)
return edge.to_id ~= "2222222222222222222"
end,
})
The IDs above are examples. Earlier edit-history IDs resolve to the collected
current post for selections, lookups, and graph edges. Plans use the collected
ID once. An unknown or ignored seed fails planning.
Inclusion filters apply uniformly to replies reached indirectly. Rejecting a
post skips its preservation, while traversal continues. Rejecting an edge
prunes that path; another accepted path can still reach the same node.
Traversal visitation and preservation state are separate. Requests with callbacks
walk breadth first independently for each seed, evaluating each reached post and
eligible outgoing edge once per request. Callback-free seeds within one declaration
share visited nodes, preserving the same union without repeating overlapping walks. Callbacks should use item and edge data rather than depend on the
order of visits. Edge from_id and to_id describe the traversal direction;
a replied_to step in thread preservation can point to an own reply parent.
edge.direction explicitly distinguishes child from parent traversal.
Inclusion and edge callbacks receive a fresh second argument with seed_id,
resolved to its collected current ID:
preserve_thread_when(function(post)
return (post.metrics.like_count or 0) >= 100
end, {
name = "Replies near popular seeds",
include_post = function(post, context)
local seed = get_post(context.seed_id)
return math.abs(post.created_at - seed.created_at) <= 7 * 86400
end,
})
All selection functions accept an optional { name = "Description" } table.
Preservation options can combine that name with callbacks. Repost preservation
accepts inclusion only, because repost activities have no traversable edges.
Unsupported arguments, unknown options, and empty names fail before selections
are registered; a deletion function never silently ignores an extra filter.
Ordinary delete_post, delete_repost, and their _when predicates request
deletion unless preserved. The corresponding force_delete_* functions
override preservation for that selected activity only; deletion never
cascades. Selection requests accumulate independently of declaration order:
delete = forced_deletion OR (ordinary_deletion AND NOT preserved)
An item receiving no deletion request remains unchanged without being marked
preserved. Multiple matching predicates combine as requests, not last-write
assignments.
Lua data and editor declarations
api/cleaner.lua describes the runtime functions, callback
types, and fields for editor completion. Add that file to your editor’s Lua
workspace library; do not execute it as part of the policy. Runtime bindings belong to
internal/policy; selection and graph behavior belong to internal/planner.
Callbacks receive fresh item records with id, author_id, kind, text,
created_at (Unix seconds), fractional age_days, is_reply, is_quote,
metrics, and typed references. Repost records additionally have source_id;
their id is the own repost activity ID. IDs are strings throughout. Missing
metric values are nil, not invented zeroes. The complete available long-post
text is used when returned by X. Optional language, attachments, and entities
expose returned language codes, media/poll identifiers, and hashtag, cashtag,
mention, and URL spans. Missing objects and fields remain nil. Long-post entities
correspond to the exposed long text; ordinary text entities are not substituted
when long-post entities are absent. Nested tables are fresh copies too. These
fields use the same timeline pages and do not expand foreign records.
get_post, get_repost, get_posts, get_reposts, get_replies, and
get_quotes expose only collected owned records. Reply and quote queries
return all direct own children of an own graph node. Mutating a returned
Lua table does not change inventory. There is no global profile object or
mandatory lifecycle entry point.
Registration creates Go rule descriptions immediately. The top-level Lua
configuration finishes before selection predicates run. Predicates execute
sequentially in declaration order against stable per-kind candidate lists;
preservation walks then execute. Lua closures retain their shared variables.
Queries block until the required inventory is available. This is deferred,
lazy evaluation; it does not run Lua callbacks concurrently.
Callbacks must return actual booleans. They can query data but cannot register
new selections while evaluation is underway. Configuration errors, callback
errors, and timeouts abort the entire plan before execution. Lua has base,
table, string, and math libraries, without filesystem, process, package-loading,
credential, or HTTP access. print and dynamic code-loading globals are absent.
Data loads on demand. An empty policy or empty ID arrays perform no timeline
requests. Post and repost views are normalized only when selected or queried;
reply and quote indexes are built independently when needed. Queries share one
cached timeline snapshot, including queries made inside predicates. Collection
errors abort planning even when Lua catches them with pcall.
The default policy deadline is 10 seconds and includes lazy reads and their
quota waits; --policy-timeout changes it. For example, use
--policy-timeout 20m when planning may need to wait for a 15-minute quota reset.
Authentication
The default Bazel runner reuses the Article uploader’s
Vault-backed injection configuration and
OAuth 1.0a user-context credential. Its four environment variables are documented
under Article uploader credentials.
The existing AppRole and Vault path remain owned by that configuration; the
cleaner does not duplicate secret references or provision credentials. The
application’s user authorization needs read/write permissions.
Requests use the shared SDK’s OAuth 1.0a signer, with a fresh timestamp and nonce
after each quota wait. Credential values never enter Lua, plans, source, logs,
or command-line arguments. To run the executable with credentials already
injected, use //projects/x_profile_cleaner/cmd/x_profile_cleaner directly;
it expects the same four environment variables. Credential issuance and host
configuration remain outside this project.
The default endpoint is https://api.x.com/2. --api-base-url accepts another
HTTPS endpoint or loopback HTTP for isolated fixtures. Redirects are refused.
Run the CLI only with an endpoint you trust to receive authenticated requests.
Local browser interface
bazel run //projects/x_profile_cleaner -- \
server serve --config /absolute/path/policy.lua
The HTTP backend uses chi for routing and
standard net/http middleware. Open the private link printed on stdout.
server serve binds to an available loopback
port; --listen 127.0.0.1:8080 selects a fixed port. Non-loopback addresses are
rejected. The page uses the site’s shared light/dark theme and embedded assets,
without fetching scripts, fonts, or styles from external services.
Edit the Lua policy in the page, or choose a file with Load file. --config
loads the initial policy from disk once; omitting it starts with the maintained
example. File selection reads browser-local text, never an arbitrary path on the
server. Loading and editing a policy do not execute it or modify its file.
Run plan evaluates the policy without mutations. Review each candidate’s
text, date, target, and matching rules; uncheck items to exclude them from this
run. Apply selected asks for confirmation, then executes exactly the selected
subset of the server-held plan. Editing the policy requires another plan. The
browser submits action indexes, never replacement action objects. A new plan
invalidates the old one; apply consumes its plan before starting, preventing
replay after reload or a repeated click. Exclusions are temporary and do not
rewrite the policy. An interrupted run retains its submitted selection and confirmed
completion indexes. Resume continues only unfinished actions, rechecks the
account, and uses the original selection even if the editor has changed. It does
not fetch a new timeline or rerun the policy.
Search filters the visible rows without changing their selection. Select
matching and Exclude matching affect only those rows; the page reports
selected items hidden by the filter because apply still includes them. Excluded
rows are marked explicitly. Long post previews are truncated; inline Show more
reveals the complete collected text before applying. Rule names share the post-ID
row. The editor stays visible, with Load file in its header. On desktop,
Policy and Logs fill the left column beside a full-height Review panel. The editor,
logs, and removal list scroll independently; the review header and controls stay
visible. On narrow screens, the panels stack vertically. Active progress and
results appear above the logs.
The page shows the same progress and quota-wait logs as stderr, retaining the
latest 1,000 lines with a 4 KiB limit per line. Only one operation runs at a time.
Cancel operation or Ctrl-C cancels pending work; X may already have accepted
in-flight deletions. Closing or reloading the page leaves the job running while
server serve stays open. A reload restores server status and logs, but unsaved
editor
changes and exclusions for an unsubmitted plan are local to that page. After an
interrupted apply, reloading restores its submitted selection and progress, and
Resume remains available. Run plan replaces that execution record. Resume
state exists only while the same server serve process remains running.
Policies, plans, and job status are held in memory for this server process.
The private link contains a per-run access key; keep it private. The page removes
the key from its address bar and retains it for that tab’s session. HTTP APIs
require it and reject foreign hosts and origins. OAuth credentials remain in Go
and are never sent to the page. Restarting server serve requires its new access link.
Commands
Run the Bazel command from the repository root, supplying absolute input and
output paths because Bazel may execute within runfiles:
bazel run //projects/x_profile_cleaner -- \
plan --config /absolute/path/policy.lua --out /absolute/path/plan.json
bazel run //projects/x_profile_cleaner -- \
apply --plan /absolute/path/plan.json
bazel run //projects/x_profile_cleaner -- \
apply --config /absolute/path/policy.lua
bazel run //projects/x_profile_cleaner -- \
apply --config /absolute/path/policy.lua --yes
plan writes a private, atomically replaced JSON file; omit --out to emit
JSON on stdout. The plan contains schema version 1, the authenticated account
ID, a fixed evaluation time, and the exact typed action list. Post deletion
targets the own post ID; an unrepost action targets the source post ID. Repost
removals appear before post deletions, with stable ID ordering in each group.
Execution can interleave the two endpoint groups.
Saved-plan apply validates the entire plan, confirms the authenticated account
matches, and executes the list without rereading the timeline or Lua file.
Providing a saved plan is explicit execution, without an additional prompt.
Inline apply uses the same planner, displays the exact list, and asks for y
or yes. Declining or reaching EOF performs no mutations. -y and --yes
skip only that inline confirmation. Config and saved-plan inputs are mutually
exclusive. Ctrl-C interrupts confirmation immediately even while stdin remains
open, exits unsuccessfully, and performs no mutation.
Timestamped progress logs and the confirmation prompt go to stderr. Logs show
account identification, policy evaluation, timeline pages and record counts,
prepared actions, and execution progress. Each mutation reports its action index,
operation, and target ID; confirmed completion counts increase across both
workers. Quota waits report the affected endpoint, wait duration, and resumption
time, followed by a message when the allowance becomes available. A stopped apply
reports confirmed progress; outstanding actions can still have an unknown outcome.
Progress logs omit credentials, headers, response bodies, and post text. API
failures retain HTTP status and up to three problems, with only selected diagnostic
fields truncated to 160 characters each. Known credential values are redacted.
Timeline errors identify the failing page and count already collected, including
HTTP-success responses containing partial errors. Such failures still abort the
complete plan without publishing partial actions.
Stdout retains plan JSON or the command’s action list and result summary. For
example, plan --config /absolute/path/policy.lua > plan.json 2> progress.log
keeps a parseable plan and a separate progress log. --explain deliberately
includes snapshot text on stderr in addition to these operational logs.
Plans also contain informational decisions for each loaded activity: its text,
date, outcome (unchanged, preserved, delete, or force_delete), matching
rule IDs/names, and one witness seed per preserving declaration. --explain on
plan or apply prints these on stderr, separate from executable actions. A rule
ID distinguishes declarations even when names repeat. Decisions never authorize
execution; older plans without them remain valid. Plan files contain snapshot
text and should be handled as account data.
Apply runs at most one post-deletion request and one repost-removal request
concurrently. Each worker keeps its actions in plan order and obeys its endpoint
quota. Actions sharing a target ID wait for their earlier planned operation to
succeed, even across endpoints. A mutation returning HTTP 404 is logged as already
absent, counted as completed, and skipped. On other failures, apply cancels both
workers, stops further dispatch, waits for outstanding calls to return, reports the
confirmed completed-action count, and returns nonzero. Already accepted server operations
may complete despite cancellation, and an interrupted response can leave their
outcome unknown. These actions remain unfinished for explicit UI resumption;
confirmed completions are never repeated by Resume. The completed count is not
necessarily a prefix of the plan. Requests are not automatically replayed. Rate-limit
failures include HTTP status, Retry-After, and reset metadata without dumping
the response body. This version has no persistent execution journal.
The application owns plan-source validation, saved-plan loading, Lua planning,
and execution. Commands share one application instance, configured after flags
are parsed. The browser adapter retains plans and selects subsets; it uses the
same planner, executor, and endpoint quota state as the CLI.
Requests and rate limits
API operations use the repository’s generated x_sdk.
Discovery requests 100 records per timeline page and caches the pages for the
planning run. It performs no individual post lookups. X returns posts, replies,
and repost activities through the same timeline; a repost-only policy still
receives mixed pages but does not normalize ordinary posts or build a graph.
Post deletion and repost removal each accept one target per request, so apply
uses one sequential worker for each independent endpoint bucket.
The documented OAuth user-context buckets are independent per endpoint:
| Operation | Endpoint | Requests per 15 minutes |
|---|
| Account identification | GET /2/users/me | 75 |
| Timeline pages | GET /2/users/:id/tweets | 900 |
| Delete a post or reply | DELETE /2/tweets/:id | 50 |
| Undo a repost | DELETE /2/users/:id/retweets/:post_id | 50 |
These are client defaults, verified against X’s rate-limit documentation.
Valid response limit, remaining, and reset headers update each bucket. When its
allowance reaches zero, the next request waits until reset with a one-second
margin. Missing or invalid headers retain the local allowance and 15-minute
window. Quota state belongs to one CLI process; other clients using the account
can consume the same server quota. An unexpected 429 stops the operation without
automatic replay. Ctrl-C cancels quota waits. Each dispatched network request
has a separate 30-second deadline, which starts after admission.
At 100 records per page, 3,200 records need about 32 full-page reads. Deletion is
the bottleneck: 50 per 15 minutes is 200 per hour on average, per bucket, so a large initial
cleanup can take hours; the two mutation buckets can make progress concurrently. API access and billing limits are separate from these
request windows. Apply has no overall policy deadline once the plan is ready.
Discovery boundary
Complete historical discovery is outside scope. The CLI paginates only the
available user timeline, which X documents as limited to the latest 3,200
posts. It does not import archives or use historical search. A successfully
constructed plan does not establish complete historical or graph coverage.
Partial response errors, conflicting records, incomplete owned records, and
repeated pagination tokens fail planning.
Restricting discovery to a time window can omit a preservation seed, a
connecting quote/reply, or other members of its thread. A directly requested
seed absent from the inventory
fails planning; a seed that is present can still have an incomplete graph if
connecting posts are missing. Thread preservation therefore applies only to
the graph discovered inside the configured window. Age predicates filter
deletion candidates within that inventory; they do not fetch missing context.
Chunked discovery intentionally accepts this limitation and does not establish
complete thread membership or bypass X’s documented historical coverage limit.
References: user timeline,
post deletion, and
repost removal.
Validation
bazel test //projects/x_profile_cleaner:test
The browser suite drives the built server with pinned Chromium and a local X
fixture. It verifies policy loading, non-mutating planning, exact exclusions,
confirmation, stale-plan rejection, access checks, cancellation, API failures,
reload behavior, escaped content, and visible quota logs. It produces light,
dark, and narrow-screen screenshots plus serve-acceptance.json in Bazel’s test
undeclared outputs.
The CLI E2E suite runs the built command against a local HTTP fixture. It checks
paginated collection, branching graph preservation, filtering, own replies to
foreign posts, repost age and identifiers, forced precedence, saved and inline
apply, confirmation and both yes flags, account mismatch, invalid policy and
plan input, direct ID arrays, edit-history aliases and conflicts, exact mutation
paths, concurrent endpoint dispatch, same-target dependencies, cancellation of
in-flight work, strict arguments, named decision reports, relative windows,
optional metadata, seed context, large overlapping threads, restricted Lua libraries, lazy cached queries, reply parents reached
through quotes, independent quota waits, cancellation, and missing or null
mutation confirmations. It also interrupts confirmation with stdin left open,
checks stdout/stderr separation, and emits operator-progress.log for inspection.
It independently verifies OAuth signatures on all
requests, including pagination and mutations, rejects incomplete credentials
before HTTP, and checks that output contains no fixture credential values. It emits
cleanup-plan.json in Bazel’s test undeclared outputs. No live X credentials
or live deletion are used. Maintained change state lives in openspec/.