Get the FREE Ultimate OpenClaw Setup Guide →

terminal

npx machina-cli add skill DojoCodingLabs/code-sensei/terminal --openclaw
Files (1)
SKILL.md
2.8 KB

Terminal & Command Line — CodeSensei Teaching Module

The Terminal

  • Analogy: The terminal is like texting your computer. Instead of clicking buttons, you type instructions and it responds. It's not scarier than that.
  • Key insight: Everything you can do by clicking in a graphical interface, you can do faster by typing in the terminal. Developers prefer typing because it's faster and scriptable.

Essential Commands

Teach these as they appear in the user's session:

Navigation

  • cd [folder] — "Change Directory" — walk into a folder
  • ls — "List" — see what's in the current folder
  • pwd — "Print Working Directory" — "where am I right now?"
  • Analogy: You're in a building. cd is walking to a room, ls is looking around, pwd is checking the room number on the door.

File Operations

  • mkdir [name] — "Make Directory" — create a new folder
  • touch [file] — create a new empty file
  • cp — copy, mv — move/rename, rm — delete
  • ⚠️ Teach: rm is permanent. There's no trash can.

npm (Node Package Manager)

  • Analogy: An app store for code. Other developers built tools and shared them. npm install downloads those tools into your project.
  • npm install [package] — download and add a tool
  • npm run [script] — run a pre-defined task (like "start the server" or "run tests")
  • package.json — the shopping list of all tools your project uses
  • node_modules/ — the warehouse where downloaded tools live (never edit this!)

git (Version Control)

  • Analogy: A time machine for your code. Every "commit" is a save point you can go back to.
  • git add — stage changes (put items on the "to save" pile)
  • git commit — save a snapshot with a description
  • git push — upload your snapshots to the cloud (GitHub)
  • git pull — download the latest from the cloud
  • Key insight: Git exists because code breaks. It lets you undo mistakes by going back to when things worked.

Environment Variables

  • Analogy: Secret notes that your app can read but aren't written in the code itself. Like a password you whisper instead of writing on a whiteboard.
  • .env file — where secrets live (API keys, database passwords)
  • ⚠️ Teach: NEVER commit .env files to git. That's like posting your passwords publicly.

Scary-Looking but Simple

  • | (pipe) — sends output from one command as input to another, like a conveyor belt
  • > — saves output to a file instead of showing it on screen
  • && — "do this AND THEN do that" (run two commands in sequence)
  • sudo — "do this as administrator" (the master key)

Source

git clone https://github.com/DojoCodingLabs/code-sensei/blob/main/skills/terminal/SKILL.mdView on GitHub

Overview

The Terminal & Command Line module teaches basic navigation, file operations, npm, and git basics. It uses simple analogies to demystify the terminal for non-technical users and shows how typing can be faster and scriptable. Practical examples help you work more efficiently in real projects.

How This Skill Works

The skill covers key commands (cd, ls, pwd, mkdir, touch, cp, mv, rm), npm (install, run), git (add, commit, push, pull), and environment management (.env). Lessons combine analogies with hands-on tasks to reinforce how the terminal operates and how to avoid common pitfalls.

When to Use It

  • Starting a new project and installing dependencies with npm install
  • Navigating a project quickly to locate files using cd, ls, and pwd
  • Version controlling changes with git (add, commit, push, pull) and syncing with GitHub
  • Running and chaining commands, and redirecting output with pipes, >, and &&
  • Managing secrets and configuration in .env without committing them

Quick Start

  1. Step 1: Open terminal and navigate to your project folder with cd and ls
  2. Step 2: Create files and initialize npm: mkdir project; cd project; touch README.md; npm init -y
  3. Step 3: Install a package and run a script: npm install [package]; npm run [script]

Best Practices

  • Practice in a safe test directory to avoid accidental data loss
  • Always verify your current directory with pwd before making changes
  • Prefer npm install in the project root and keep package.json readable
  • Use clear, descriptive git commit messages and push regularly
  • Be cautious with rm; verify paths and avoid blindly deleting files

Example Use Cases

  • Create a new Node project: mkdir app && cd app; touch README.md; npm init -y; npm install [package]
  • Explore a repo and run tests: cd repo; ls; npm run test
  • Build and log output: npm run build > build.log 2>&1
  • Track changes with git and push: git add ., git commit -m "feat: add logging"; git push
  • Manage secrets safely: create .env, reference it in code, never commit .env to Git

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers