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 CodeTrain CLI's 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 CodeTrain CLI 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 CodeTrain CLI, and upgrading this package does not by itself change which CodeTrain CLI 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 Join the CodeTrain Open Skill learner profile with the copy in your CodeTrain account; neither overwrites the other
codetrain update Fetch the newest CodeTrain CLI 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 CodeTrain CLI is installed. Default ~/.codetrain
CODETRAIN_BASE Download origin. Default https://codetrain.ai
CODE_TRAINER_HOME Where the auth token is stored. Default ~/.config/codetrain

Metadata

Release files for codetrain-cli 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codetrain-cli 0.2.2
File Size Uploaded
codetrain_cli-0.2.2.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codetrain-cli 0.2.2
File Interpreter ABI Platform
codetrain_cli-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / codetrain_cli-0.2.2.tar.gz

Download URL codetrain_cli-0.2.2.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a2cf3b8c7196d9374ea2d5dfd45b325f0a0b4354345617a81e91d44ba7e25e11
BLAKE2b-256 checksum
How to use checksums
6110eac080de20edb61d427c0ee812330a8257efb0883ee462369aa50afe84bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / codetrain_cli-0.2.2-py3-none-any.whl

Download URL codetrain_cli-0.2.2-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c6e935392ff926e95c617dfa6254583edbe8d146e7ae56ea363e3e16f53ad03
BLAKE2b-256 checksum
How to use checksums
e1764aebe95d25eca778ab4ba8263486fe0394df3e1422850822b23697a8df21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release 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