Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>CP Input TXTNew to Visual Studio Code? Get it now.
CP Input TXT

CP Input TXT

Al Kayes Rifat

|
2 installs
| (0) | Free
Instantly save Competitive Companion sample testcase inputs into input.txt
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CP Input TXT

CP Input TXT

Saves sample test cases from Competitive Companion directly into input.txt.

How It Works

  1. Make sure you have the Competitive Companion browser extension installed.
  2. Open your code file or folder in VS Code.
  3. Click the Competitive Companion button on any problem page (Codeforces, AtCoder, CSES, LeetCode, etc.).
  4. The test case inputs are automatically written to input.txt next to your active file.

Features

  • Saves where you work: Writes input.txt in the folder of your currently active file (or workspace root).
  • Run code with Ctrl+Enter: Press Ctrl+Enter (Cmd+Enter on macOS) to instantly compile and run your code with input fed directly from input.txt in the terminal.
  • Multi-language support: Built-in support for C++, C, Python, Java, Rust, Go, JavaScript, TypeScript, and Kotlin, with customizable commands.
  • Flexible format: Combine all sample test cases or save only the first test case.
  • Optional expected output: Can also save sample outputs into output.txt.
  • Status bar & menu: Click the status bar item to run code, toggle the listener, open input.txt, or clear it.

Running Code from input.txt

When working on a problem, press Ctrl+Enter (Cmd+Enter on macOS) inside your code file (or while editing input.txt):

  1. Automatically saves any unsaved changes in your solution and input.txt.
  2. Compiles (if necessary) and runs the code in a dedicated terminal (CP Input TXT).
  3. Passes input.txt into standard input (< input.txt).

Supported Placeholders in Commands

You can customize run commands for any language in settings using these placeholders:

  • ${file}: Full path to the active code file
  • ${fileBasename}: File name with extension (e.g. solution.cpp)
  • ${fileBasenameNoExtension}: File name without extension (e.g. solution)
  • ${fileDirname}: Directory containing the file
  • ${fileExtname}: File extension (e.g. .cpp)
  • ${inputFile}: Full path to the input file
  • ${inputFileName}: Name of the input file (e.g. input.txt)

Settings

Setting Default Description
cpInputTxt.runOnCtrlEnter true Run code with input.txt in the terminal when pressing Ctrl+Enter
cpInputTxt.runCommands (built-in defaults) Custom compile and run command templates per language ID (cpp, python, java, etc.)
cpInputTxt.customRunCommand "" Global custom command override for all languages
cpInputTxt.saveBeforeRun true Automatically save files before running
cpInputTxt.clearTerminalBeforeRun false Clear the terminal before executing run commands
cpInputTxt.port 10045 Port to receive data from Competitive Companion
cpInputTxt.fileName input.txt Target file name for inputs
cpInputTxt.saveLocation activeFolder Where to save (activeFolder or workspaceRoot)
cpInputTxt.testCaseFormat all Save all test cases (all) or first only (first)
cpInputTxt.openOnSave false Automatically open input.txt after receiving test cases
cpInputTxt.saveExpectedOutput false Also save expected outputs to output.txt
cpInputTxt.outputFileName output.txt Target file name for expected outputs

License

This project is licensed under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft