Engineering Tools for AI

Программирование

Основные команды терминала

Поисковый справочник по командам терминала для редактирования, запуска, тестирования и отладки web-проекта.

33 команд

Навигация

print working directory

pwd

pwd

Значение

Prints the absolute path of the folder where the terminal is currently working.

Когда использовать

Run it before commands that depend on being inside the project folder.

Пример

pwd

Пример запроса

Check which folder the terminal is currently in.

Навигация

list files

ls

ls

Значение

Lists files and folders in the current directory.

Когда использовать

Use it to confirm expected files such as package.json, src, or next.config.mjs are present.

Пример

ls

Пример запроса

List the files in the current project folder.

Навигация

change directory

cd

cd ~/projects/my-web-app

Значение

Moves the terminal to another folder.

Когда использовать

Use it before running project-specific commands such as npm run build.

Осторожно

A command can fail if you are in the wrong folder, even when the command itself is correct.

Пример

cd ~/projects/my-web-app

Пример запроса

Move to the project folder before running commands.

Навигация

clear screen

clear

clear

Значение

Clears visible terminal output without changing files or command history.

Когда использовать

Use it before rerunning a command when the old output is visually noisy.

Пример

clear

Пример запроса

Clear the terminal before rerunning the build.

Файлы и папки

show file contents

cat

cat package.json

Значение

Prints the contents of a file to the terminal.

Когда использовать

Use it for short files such as package.json, config files, or small text files.

Осторожно

For very large files, prefer sed, rg, or a pager instead of printing everything.

Пример

cat package.json

Пример запроса

Show the package.json scripts.

Файлы и папки

show selected lines

sed

sed -n '1,120p' src/components/SiteHeader.tsx

Значение

Can print a selected range of lines from a file.

Когда использовать

Use it to inspect one section of a source file without opening the whole file.

Пример

sed -n '1,120p' src/components/SiteHeader.tsx

Пример запроса

Show the first 120 lines of SiteHeader.tsx.

Файлы и папки

make directory

mkdir

mkdir -p src/app/[locale]/reference/terminal-commands

Значение

Creates a new folder. The -p option also creates missing parent folders and avoids failing if the folder already exists.

Когда использовать

Use it before adding a new page folder or asset folder.

Пример

mkdir -p src/app/[locale]/reference/terminal-commands

Пример запроса

Create the route folder for the terminal commands page.

Файлы и папки

copy files

cp

cp .env.example .env.local

Значение

Copies a file or folder to another location.

Когда использовать

Use it to create local config from an example file or duplicate a template.

Осторожно

If the destination file exists, cp can overwrite it.

Пример

cp .env.example .env.local

Пример запроса

Copy the example env file only if it will not overwrite local settings.

Файлы и папки

move or rename

mv

mv old-name.ts new-name.ts

Значение

Moves a file or folder, or renames it when the destination is in the same folder.

Когда использовать

Use it when changing a filename, route folder name, or moving assets.

Осторожно

Renaming route folders changes URLs.

Пример

mv old-name.ts new-name.ts

Пример запроса

Rename this file and update imports if needed.

Безопасность

remove files

rm

rm unused-file.ts

Значение

Deletes files. With -r it can delete folders recursively.

Когда использовать

Use it only when a file is intentionally removed from the project.

Осторожно

rm is destructive. Check the path carefully before running it.

Пример

rm unused-file.ts

Пример запроса

Before deleting this file, explain what will be removed.

Поиск и проверка

ripgrep search

rg

rg -n "errorMessageGuide" src

Значение

Searches text quickly across files.

Когда использовать

Use it to find imports, components, slugs, CSS classes, or old names before editing.

Пример

rg -n "errorMessageGuide" src

Пример запроса

Search where this component is imported.

Поиск и проверка

list tracked-looking files fast

rg --files

rg --files src/app

Значение

Lists file paths quickly, respecting common ignore rules.

Когда использовать

Use it to find page files, components, and libraries without scanning build output.

Пример

rg --files src/app

Пример запроса

List reference page files under src/app.

Поиск и проверка

find paths

find

find src -name 'page.tsx'

Значение

Searches the filesystem by path, name, or other file properties.

Когда использовать

Use it when searching by filename pattern rather than text content.

Пример

find src -name 'page.tsx'

Пример запроса

Find every page.tsx route file.

Поиск и проверка

count lines or words

wc

wc -l src/lib/terminal-commands.ts

Значение

Counts lines, words, or bytes.

Когда использовать

Use it to estimate file size or count search results when combined with other commands.

Пример

wc -l src/lib/terminal-commands.ts

Пример запроса

Count how many lines are in this data file.

Пакеты

install dependencies

npm install

npm install

Значение

Installs packages listed in package.json and package-lock.json.

Когда использовать

Use it after cloning a project or when dependencies are missing.

Осторожно

It can change package-lock.json if dependency versions resolve differently.

Пример

npm install

Пример запроса

Install dependencies only if node_modules is missing.

Dev-сервер

start dev server

npm run dev

npm run dev

Значение

Runs the project's local development server script.

Когда использовать

Use it to test pages in the browser while editing.

Осторожно

A running dev server keeps the terminal session busy until stopped.

Пример

npm run dev

Пример запроса

Start the dev server and tell me the local URL.

Пакеты

production build

npm run build

npm run build

Значение

Runs the production build script and catches many compile, route, and type problems.

Когда использовать

Run it before deployment or after adding new pages.

Пример

npm run build

Пример запроса

Run the production build and summarize warnings or failures.

Пакеты

lint check

npm run lint

npm run lint

Значение

Runs the project's lint script to catch style and static code issues.

Когда использовать

Run it before build when you want quick feedback.

Пример

npm run lint

Пример запроса

Run lint and show only actionable errors.

Пакеты

check Node version

node -v

node -v

Значение

Prints the installed Node.js version.

Когда использовать

Use it when a project or dependency requires a specific Node version.

Пример

node -v

Пример запроса

Check the Node.js version before explaining this warning.

Пакеты

run package command

npx

npx next info

Значение

Runs a command from an installed or temporarily downloaded npm package.

Когда использовать

Use it for one-off tooling commands when no package script exists.

Осторожно

npx can download packages from the network if they are not installed.

Пример

npx next info

Пример запроса

Explain whether this npx command needs network access.

Git

check Git status

git status

git status --short

Значение

Shows the current branch and changed, staged, or untracked files.

Когда использовать

Run it before edits, commits, pulls, or branch switches.

Пример

git status --short

Пример запроса

Check Git status and summarize the changed files.

Git

show code differences

git diff

git diff -- src/components/SiteHeader.tsx

Значение

Shows line-by-line differences in changed files.

Когда использовать

Use it to review exactly what changed before committing.

Пример

git diff -- src/components/SiteHeader.tsx

Пример запроса

Review the diff for this task.

Git

view commit history

git log

git log --oneline -5

Значение

Shows commit history.

Когда использовать

Use it to see recent work or find a commit to inspect.

Пример

git log --oneline -5

Пример запроса

Show the five most recent commits.

Git

stage changes

git add

git add src/lib/terminal-commands.ts

Значение

Selects changes to include in the next commit.

Когда использовать

Use explicit paths for focused commits.

Пример

git add src/lib/terminal-commands.ts

Пример запроса

Stage only files related to this terminal commands page.

Git

save commit

git commit

git commit -m "Add terminal command reference"

Значение

Records staged changes into Git history.

Когда использовать

Use it after reviewing the staged changes.

Пример

git commit -m "Add terminal command reference"

Пример запроса

Commit the staged changes with a clear message.

Dev-сервер

stop running command

Ctrl+C

Press Ctrl+C in the dev server terminal

Значение

Interrupts the currently running terminal command.

Когда использовать

Use it to stop a local dev server before closing the terminal or changing ports.

Осторожно

Use it in the terminal session where the command is running.

Пример

Press Ctrl+C in the dev server terminal

Пример запроса

Stop the running dev server.

Dev-сервер

list open files and ports

lsof

lsof -i :3001

Значение

Can show which process is using a port.

Когда использовать

Use it when a dev server fails with EADDRINUSE.

Пример

lsof -i :3001

Пример запроса

Find which process is using port 3001.

Dev-сервер

list processes

ps

ps aux

Значение

Shows running processes.

Когда использовать

Use it to inspect running development tools, servers, or background processes.

Пример

ps aux

Пример запроса

Check whether a Next.js dev server is still running.

Безопасность

stop process by PID

kill

kill 12345

Значение

Sends a signal to stop a process by process ID.

Когда использовать

Use it when a server keeps running after normal interruption is not available.

Осторожно

Check the PID carefully so you do not stop the wrong process.

Пример

kill 12345

Пример запроса

Before killing a process, show me what the PID belongs to.

Сеть

make HTTP request

curl

curl -I http://localhost:3001/ko

Значение

Sends HTTP requests from the terminal and prints the response.

Когда использовать

Use it to check whether a local or deployed URL returns 200, 404, 500, or redirects.

Пример

curl -I http://localhost:3001/ko

Пример запроса

Use curl to check whether this page returns 200.

Сеть

check network reachability

ping

ping 172.30.1.55

Значение

Checks whether a host responds to basic network packets.

Когда использовать

Use it as a rough network reachability check, not as a web app health check.

Пример

ping 172.30.1.55

Пример запроса

Check whether this device can reach the dev machine IP.

Поиск и проверка

locate command executable

which

which node

Значение

Shows which executable file will run for a command name.

Когда использовать

Use it when different Node, npm, or tool versions may exist on the machine.

Пример

which node

Пример запроса

Check which node executable is being used.

Безопасность

change file permissions

chmod

chmod +x script.sh

Значение

Changes read, write, or execute permissions on files.

Когда использовать

Use it when a local script should be executable.

Осторожно

Avoid broad permission changes such as chmod -R 777.

Пример

chmod +x script.sh

Пример запроса

Explain the safest permission change for this script.