tutorial

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tutorial provides an interactive, visually stunning tutorial for NTM

Index

Constants

View Source
const SlideCount = 9

SlideCount is the total number of slides

Variables

View Source
var AgentsDiagram = []string{
	"",
	"     +----------------------------------------------------+",
	"     |                    AI AGENTS                       |",
	"     +----------------------------------------------------+",
	"",
	"       [CC] Claude       [COD] Codex      [GMI] Gemini",
	"       -----------       -----------      ------------",
	"        Anthropic          OpenAI           Google",
	"        Architecture       Implementation   Testing",
	"        Design             Code Gen         Analysis",
	"",
}

Agent types visualization

View Source
var CelebrationBanner = []string{
	"",
	"    * * * * * * * * * * * * * * * * * * *",
	"",
	"            YOU'RE READY!",
	"",
	"    * * * * * * * * * * * * * * * * * * *",
	"",
}

Celebration banner

View Source
var ChaosDiagram = []string{
	"  +---------+ +---------+ +---------+",
	"  | Claude  | | Claude  | | Codex   |",
	"  | >_      | | >_      | | >_      |",
	"  +---------+ +---------+ +---------+",
	"        +---------+ +---------+",
	"        | Gemini  | | Claude  |",
	"        | >_      | | >_      |",
	"        +---------+ +---------+",
	"  +---------+         +---------+",
	"  | Codex   |         | Gemini  |",
	"  | >_      |         | >_      |",
	"  +---------+         +---------+",
}

Chaos diagram - multiple messy terminal windows

View Source
var CommandFlowDiagram = []string{
	"",
	"                    +-------------+",
	"                    |  ntm send   |",
	"                    |   --all     |",
	"                    +------+------+",
	"                           |",
	"             +-------------+-------------+",
	"             |             |             |",
	"             v             v             v",
	"        +--------+   +--------+   +--------+",
	"        | Claude |   | Codex  |   | Gemini |",
	"        |  (cc)  |   | (cod)  |   | (gmi)  |",
	"        +--------+   +--------+   +--------+",
	"",
}

Command flow diagram

View Source
var KeyboardDiagram = []string{
	"",
	"   +------------------------------------------------------+",
	"   |               KEYBOARD SHORTCUTS                     |",
	"   +------------------------------------------------------+",
	"",
	"    Navigation                   Actions",
	"    ----------                   -------",
	"    <- -> / h l  Move slides     s   Skip animation",
	"    1-9          Jump to slide   r   Restart slide",
	"    Home/End     First/Last      q   Quit",
	"    Space        Next slide      ?   Help",
	"",
}

Keyboard shortcuts reference

View Source
var LogoExtraLarge = []string{
	"",
	"    ██████   ██ ████████ ██████   ██████",
	"    ███░░██  ██ ░░░██░░░ ███░░██ ███░░██",
	"    ██ ░░██ ██     ██    ██  ░░████  ░██",
	"    ██  ░░███      ██    ██   ░░██   ██",
	"    ██   ░░██      ██    ██    ░░   ██",
	"    ██    ░██      ██    ██        ██",
	"    ░░     ░░      ░░    ░░        ░░",
	"",
}

Extra large logo for welcome screen

View Source
var LogoLarge = []string{
	"",
	"    ███╗   ██╗████████╗███╗   ███╗",
	"    ████╗  ██║╚══██╔══╝████╗ ████║",
	"    ██╔██╗ ██║   ██║   ██╔████╔██║",
	"    ██║╚██╗██║   ██║   ██║╚██╔╝██║",
	"    ██║ ╚████║   ██║   ██║ ╚═╝ ██║",
	"    ╚═╝  ╚═══╝   ╚═╝   ╚═╝     ╚═╝",
	"",
}

Large NTM logo with extra flair

View Source
var OrderDiagram = []string{
	"  +-------------------------------------------------------+",
	"  |              Session: myproject                       |",
	"  +-----------------+-----------------+-------------------+",
	"  |   You (shell)   |   Claude #1     |   Claude #2       |",
	"  |   $ ntm send    |   [Working...]  |   [Ready]         |",
	"  +-----------------+-----------------+-------------------+",
	"  |   Codex #1      |   Codex #2      |   Gemini #1       |",
	"  |   [Testing...]  |   [Complete]    |   [Analyzing]     |",
	"  +-----------------+-----------------+-------------------+",
}

Order diagram - organized tmux session

View Source
var PaneLayoutDiagram = []string{
	"   +-----------------------------------------------------+",
	"   |  Pane Naming:  {session}__{agent}_{number}          |",
	"   +-----------------------------------------------------+",
	"   |                                                     |",
	"   |  myproject__cc_1    ->  Claude agent #1             |",
	"   |  myproject__cc_2    ->  Claude agent #2             |",
	"   |  myproject__cod_1   ->  Codex agent #1              |",
	"   |  myproject__gmi_1   ->  Gemini agent #1             |",
	"   |                                                     |",
	"   +-----------------------------------------------------+",
}

Pane layout with agent assignments

View Source
var QuickStartCommands = []string{
	"# Create a new project with agents",
	"$ ntm quick myproject --template=go",
	"$ ntm spawn myproject --cc=3 --cod=2 --gmi=1",
	"",
	"# Send prompts to your agents",
	"$ ntm send myproject --all \"Build a REST API\"",
	"",
	"# Check status and manage",
	"$ ntm status myproject",
	"$ ntm view myproject",
}

Quick start commands

View Source
var SessionDiagram = []string{
	"  +=========================================================+",
	"  |              TMUX SESSION: myproject                    |",
	"  +=========================================================+",
	"  |                                                         |",
	"  |   +--------------+  +--------------+  +--------------+  |",
	"  |   |  Pane 0      |  |  Pane 1      |  |  Pane 2      |  |",
	"  |   |  (You)       |  |  (Claude)    |  |  (Codex)     |  |",
	"  |   |   $ _        |  |   CC >_      |  |   COD >_     |  |",
	"  |   +--------------+  +--------------+  +--------------+  |",
	"  |                                                         |",
	"  +=========================================================+",
}

Session concept diagram

View Source
var Subtitle = "Orchestrate AI coding agents in parallel"

Subtitle

View Source
var Tagline = "Named Tmux Manager — Multi-Agent Command Center"

Tagline

View Source
var TipsContent = [][]string{
	{
		"[Tip #1] Start Small",
		"",
		"Begin with 1-2 agents per type.",
		"Scale up as needed with `ntm add`.",
	},
	{
		"[Tip #2] Divide & Conquer",
		"",
		"Use Claude for architecture,",
		"Codex for implementation,",
		"Gemini for testing & docs.",
	},
	{
		"[Tip #3] Use the Palette",
		"",
		"Press F6 to open the command",
		"palette with pre-built prompts.",
	},
	{
		"[Tip #4] Save Your Work",
		"",
		"`ntm save myproject -o ~/logs`",
		"captures all agent outputs.",
	},
}

Tips content

View Source
var WorkflowDiagram = []string{
	"",
	"    +============+     +============+     +============+",
	"    |  DESIGN    | --> |  IMPLEMENT | --> |   TEST     |",
	"    |  (Claude)  |     |  (Codex)   |     |  (Gemini)  |",
	"    +============+     +============+     +============+",
	"          |                  |                  |",
	"          +------------------+------------------+",
	"                             |",
	"                             v",
	"                      +------------+",
	"                      |  REVIEW    |",
	"                      |  (All)     |",
	"                      +------------+",
	"",
}

Workflow diagram

Functions

func AnimatedBorder

func AnimatedBorder(content string, width int, tick int, colors []string) string

AnimatedBorder creates an animated border around content (ASCII only for alignment)

func GlitchText

func GlitchText(text string, tick int, intensity float64) string

GlitchText creates a glitch effect on text

func MatrixRain

func MatrixRain(width, height int, tick int) string

MatrixRain creates a matrix-style rain effect for a given width/height

func ProgressDots

func ProgressDots(current, total int, tick int) string

ProgressDots creates animated progress dots

func PulseText

func PulseText(text string, tick int, baseColor string) string

PulseText creates a pulsing brightness effect

func RenderAgentsDiagram

func RenderAgentsDiagram(tick int, width int) string

RenderAgentsDiagram renders the agents diagram with color coding

func RenderAnimatedChaosDiagram

func RenderAnimatedChaosDiagram(tick int, width int) string

RenderAnimatedChaosDiagram renders the chaos diagram with shake effect

func RenderAnimatedLogo(tick int, width int) string

RenderAnimatedLogo renders the logo with animation

func RenderAnimatedOrderDiagram

func RenderAnimatedOrderDiagram(tick int, width int) string

RenderAnimatedOrderDiagram renders the order diagram with glow effect

func RenderCelebration

func RenderCelebration(tick int, width int) string

RenderCelebration renders the celebration with particles

func RenderCommandCode

func RenderCommandCode(commands []string, tick int, typewriter bool) string

RenderCommandCode renders command code with syntax highlighting

func RenderCommandFlowDiagram

func RenderCommandFlowDiagram(tick int, step int, width int) string

RenderCommandFlowDiagram renders the command flow with animated arrows

func RenderSessionDiagram

func RenderSessionDiagram(tick int, step int, width int) string

RenderSessionDiagram renders the session concept diagram

func RenderTip

func RenderTip(tip []string, tick int, width int) string

RenderTip renders a tip card with animation

func RenderWorkflowDiagram

func RenderWorkflowDiagram(tick int, activeStep int, width int) string

RenderWorkflowDiagram renders the workflow with step highlighting

func SparkleText

func SparkleText(text string, tick int, density float64) string

SparkleText adds occasional sparkle characters to text

func TransitionEffect

func TransitionEffect(content string, transitionType TransitionType, progress float64, width, height int) string

TransitionEffect applies a transition effect between slides

func WaveText

func WaveText(text string, tick int, amplitude float64, colors []string) string

WaveText creates a wave animation effect on text

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the main tutorial Bubble Tea model

func New

func New(opts ...Option) Model

New creates a new tutorial model

func (Model) GetCurrentSlide

func (m Model) GetCurrentSlide() SlideID

GetCurrentSlide returns the current slide ID

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model

func (Model) IsTransitioning

func (m Model) IsTransitioning() bool

IsTransitioning returns whether a transition is in progress

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model

func (Model) View

func (m Model) View() string

View implements tea.Model

type Option

type Option func(*Model)

Option configures the tutorial model

func WithSkipAnimations

func WithSkipAnimations() Option

WithSkipAnimations disables animations for faster navigation

func WithStartSlide

func WithStartSlide(slide SlideID) Option

WithStartSlide sets the starting slide

type Particle

type Particle struct {
	X, Y     float64
	VX, VY   float64
	Life     int
	MaxLife  int
	Type     ParticleType
	Char     string
	Color    string
	Size     int
	Gravity  float64
	Friction float64
}

Particle represents an animated particle

func NewParticle

func NewParticle(x, y int, ptype ParticleType) Particle

NewParticle creates a new particle at the given position

func (Particle) Render

func (p Particle) Render() string

Render returns the styled particle character

func (*Particle) Update

func (p *Particle) Update()

Update advances the particle simulation

type ParticleType

type ParticleType int

ParticleType defines different particle effects

const (
	ParticleSparkle ParticleType = iota
	ParticleStar
	ParticleConfetti
	ParticleFirework
	ParticleRain
	ParticleSnow
	ParticleGlow
)

type RevealAnimation

type RevealAnimation struct {
	Lines       []string
	CurrentLine int
	Speed       int
	RevealStyle string // "fade", "slide", "typewriter"
	Done        bool
}

RevealAnimation creates a line-by-line reveal effect

func NewRevealAnimation

func NewRevealAnimation(lines []string, style string) *RevealAnimation

NewRevealAnimation creates a new reveal animation

func (*RevealAnimation) Render

func (r *RevealAnimation) Render(tick int) string

Render returns the currently visible lines

func (*RevealAnimation) Update

func (r *RevealAnimation) Update(tick int)

Update advances the reveal animation

type SlideID

type SlideID int

SlideID identifies each slide in the tutorial

const (
	SlideWelcome SlideID = iota
	SlideProblem
	SlideSolution
	SlideConcepts
	SlideQuickStart
	SlideCommands
	SlideWorkflows
	SlideTips
	SlideComplete
)

type SlideState

type SlideState struct {
	// contains filtered or unexported fields
}

SlideState holds per-slide animation state

type TickMsg

type TickMsg time.Time

TickMsg is sent on each animation frame

type TransitionDoneMsg

type TransitionDoneMsg struct{}

TransitionDoneMsg signals a transition has completed

type TransitionType

type TransitionType int

TransitionType defines how slides transition

const (
	TransitionNone TransitionType = iota
	TransitionFadeOut
	TransitionFadeIn
	TransitionSlideLeft
	TransitionSlideRight
	TransitionZoomIn
	TransitionZoomOut
	TransitionDissolve
)

type TypingAnimation

type TypingAnimation struct {
	Lines       []string
	CurrentChar int
	Speed       int // ticks per character
	Cursor      string
	CursorBlink bool
	Done        bool
}

TypingAnimation creates a typing effect for text

func NewTypingAnimation

func NewTypingAnimation(lines []string) *TypingAnimation

NewTypingAnimation creates a new typing animation

func (*TypingAnimation) Render

func (t *TypingAnimation) Render(tick int) string

Render returns the currently visible text with cursor

func (*TypingAnimation) Update

func (t *TypingAnimation) Update(tick int)

Update advances the typing animation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL