Skip to main content

CodeTrain CLI

A Socratic AI coding tutor that teaches you on your own codebase and never writes your code for you. It breaks a real task into small steps, explains the part you need before you attempt it, then asks you to write the code. Each step runs. If it does not pass, the step does not advance, and the tutor asks a question instead of handing over the answer.

pip install codetrain-cli
codetrain login
codetrain start --mode repo

Free for ten lessons a month, no card. https://codetrain.ai

What this package is

A launcher, not the tutor itself. Installing it gives you the codetrain command. The first time you run it, it downloads the agent bundle from https://codetrain.ai/dist/, checks it against the published SHA-256, and unpacks it to ~/.codetrain/agent. After that it runs offline, and it checks for a newer bundle at most once a day.

It works this way so there is only ever one copy of the agent on your machine. The other install route is curl -fsSL https://codetrain.ai/install.sh | sh, which puts the same files in the same place and installs this same launcher. Whichever you use, and even if you use both, the codetrain command runs the same code and there is no version to keep in sync.

Updating is the same story. Once a day the command checks whether the published bundle has changed and replaces its own copy if it has. codetrain update forces the check; CODETRAIN_NO_UPDATE=1 switches it off. You do not need to reinstall this package to get a newer agent, and upgrading this package does not by itself change which agent you run.

If your environment forbids downloads at run time, use the shell installer instead, or unpack the bundle yourself.

Where your code goes

Nowhere. The tutor runs on your machine and serves its interface on 127.0.0.1. What crosses the network is your API token, and on the managed plan the prompt snippets sent to the model proxy. Bring your own key and the model calls go straight to your provider instead.

Repository reading refuses anything that looks like a secret, and refuses files your .gitignore already excludes.

Commands

Command What it does
codetrain login Connect this machine to your account
codetrain status Plan, lessons used, managed budget remaining
codetrain start --mode repo Learn the repository in the current directory
codetrain start --mode sandbox A throwaway practice project
codetrain tutor Review what you just wrote
codetrain end End the active lesson
codetrain sync Sync your learner profile to and from the cloud
codetrain update Fetch the newest agent bundle now

Requirements

Python 3.9 or newer, and nothing else. No dependencies, by design: this lands on a learner's machine, and every dependency is one more thing that can refuse to install behind a corporate proxy.

Environment

Variable Effect
CODETRAIN_NO_UPDATE Skip the daily bundle check
CODETRAIN_HOME Where the agent is installed. Default ~/.codetrain
CODETRAIN_BASE Download origin. Default https://codetrain.ai
CODE_TRAINER_HOME Where the auth token is stored. Default ~/.config/codetrain

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codetrain_cli-0.2.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codetrain_cli-0.2.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file codetrain_cli-0.2.1.tar.gz.

File metadata

  • Download URL: codetrain_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for codetrain_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 51a312287e8eca243616503457e0e5561f27410cbe8ff390419512f74cb56e3c
MD5 8c90a2a054d20f4d7d5718b35415d7d7
BLAKE2b-256 e4f6d07e87577ce982a67e728762be2d260399989b7cbe00131f9ada3d3c7c1d

See more details on using hashes here.

File details

Details for the file codetrain_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: codetrain_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for codetrain_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00363f307d84e52ce40b24d516801e568688c169c1f101751793d9497a9d2463
MD5 6a8bfda5f4dc6f02dc4193f568b67e63
BLAKE2b-256 3e147ab4e68674941b11219976fb8302e1270b9258d426237511513268f22593

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page