StudioNEW

trak done

Aliases:trak completetrak mark

Marks a curriculum module as completed in trak.json, updates completion metrics, and points to your next exercise.

$ trak done <module> [flags]

Command Overview

Supports smart prefix matching ('trak done 00', 'trak done 1'), keyword search ('trak done runtime'), and full folder names ('trak done 00-setup-and-prerequisites'). Essential for hands-on architectural laboratory tracks (Docker, Kubernetes, AWS, PostgreSQL, Linux, Git) that do not have automated compilers. Aliases include 'trak complete' and 'trak mark'.

Smart Module Resolution (No Full Names Required)

Prefix & Fuzzy Matching

Typing or copying full folder names like 00-setup-toolchain-and-first-program is completely optional. Trak CLI automatically resolves module targets through 4 multi-tier matching rules:

01. Numeric Prefix

Type unpadded numbers or numeric prefixes. Trak normalizes leading zeros and trailing hyphens.

$ trak done 00
$ trak done 00-
$ trak done 1
02. Shell Tab-Completion

Terminal tab-completion with relative paths and trailing slashes (.\ or /) is cleanly sanitized.

$ trak done .\00-setup*\
$ trak done 01-var*/
03. Keyword Search

Type any distinct keyword or topic from the module name. Case-insensitive substring matching.

$ trak done toolchain
$ trak done pointer
$ trak done memory
Ambiguity Guard: If a keyword matches multiple modules (for example, typing a generic query like test), Trak stops execution safely, displays all matching module candidates in your terminal, and prompts you to specify.

Execution Lifecycle

1
Manifest Inspection — Verifies workspace context by locating trak.json
2
Smart Resolution — Matches module by exact key, numeric prefix, or keyword substring
3
State Mutation — Flips module completion to true and formats trak.json with 2-space indentation
4
Metric Recalculation — Computes updated completion count and progress percentage
5
Rewarding Feedback — Prints completion confirmation, updated progress bar, and next exercise tip

Available Flags

-h, --helpType: boolean • Default: false

Show done command help.

Usage Examples

Mark by Module Number
$trak done 00

Marks Module 00 as complete using numeric prefix.

Padded Number Matching
$trak done 1

Automatically matches 01-runtime-and-escape-analysis.

Mark Using Trailing Hyphen Prefix
$trak done 00-

Marks Module 00 using prefix notation with trailing hyphen.

Using Command Alias
$trak complete 02

Marks Module 02 as complete using the complete alias.

Keyword Matching
$trak mark goroutines

Matches module containing 'goroutines' in its name without typing full path.

Using Tab-Completed Folder Path
$trak done .\00-setup-toolchain-and-first-program\

Trak automatically cleans trailing slashes and relative path dots.

Important Technical Guidelines

Shorthand Targeting: Full Folder Name is Not Required

You do not need to type the full module folder name. You can pass '00', '00-', '1', a unique keyword (e.g. 'docker', 'runtime'), or tab-complete the relative path (.\00-setup*\). Trak normalizes and resolves the target automatically.

Essential for Architectural Labs

While language tracks can be completed automatically via 'trak verify', architectural tracks (Docker, AWS, PostgreSQL, Linux, Kubernetes) rely on 'trak done <module>' once you finish the hands-on commands in the module README.

Frequently Asked Questions (FAQ)

Q:What is the difference between trak verify and trak done?
trak verify executes native test runners to validate code correctness before marking completion. trak done allows you to mark completion directly, which is ideal for architecture labs or manual review.