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.0.tar.gz (12.7 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.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codetrain_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 12.7 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.0.tar.gz
Algorithm Hash digest
SHA256 9a074f2fe3063e84aa64e99c62e4cf98b6b7b17eb790bda8551834e5ad0899bb
MD5 658414da5f433850683c9459d0e19346
BLAKE2b-256 71accc9a3a6a96054960d83370a0239440b6ce4bedf9c77d6c7788c6ca4fe136

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codetrain_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 684e6c119dd3d6fc9b7fdebae03258d5abb5530b6dd52828dfed34774adbeb30
MD5 c2bdebfe31afbe31e8f788c0ff8281d5
BLAKE2b-256 93ffd86317184939c86f5b1066d1efcde12accf997b5746d8bcbf10f0839dc73

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

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