← 返回命令列表

Linux command

idea 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Open project

idea [project-directory]

Open file

idea [file.java]

Open at line

idea --line [42] [file.java]

Compare files

idea diff [file1] [file2]

Merge files

idea merge [local] [remote] [base] [output]

Wait for IDE

idea --wait [file]

Format files

idea format -r -s [code-style.xml] [src/]

Run inspections headlessly

idea inspect [project_dir] [inspection-profile.xml] [out_dir]

说明

idea is the command-line launcher for IntelliJ IDEA. It opens files, projects, and invokes IDE features from the terminal. The tool supports diff, merge, and project navigation. It integrates with git and other tools requiring an editor.

参数

--line _NUM_
Open the file with the cursor at the given line number.
--column _NUM_
Open at a specific column (combine with --line).
diff _file1_ _file2_
Open the diff viewer comparing two files.
merge _local_ _remote_ _base_ _output_
Open the three-way merge tool.
format _options_ _files_
Apply project code-style formatting to one or more files non-interactively.
inspect _project_ _profile_ _output_
Run code inspection on a project headlessly and write the report to _output_.
installPlugins _id_...
Install plugins by ID from JetBrains Marketplace or a custom repository.
--wait
Block until the opened file is closed (useful as $EDITOR).
nosplash
Skip the splash screen at startup.
dontReopenProjects
Show the welcome screen instead of reopening the previous projects.
disableNonBundledPlugins
Launch with only bundled plugins; helpful for troubleshooting.
--help
Display help information.

FAQ

What is the idea command used for?

idea is the command-line launcher for IntelliJ IDEA. It opens files, projects, and invokes IDE features from the terminal. The tool supports diff, merge, and project navigation. It integrates with git and other tools requiring an editor.

How do I run a basic idea example?

Run `idea [project-directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --line _NUM_ do in idea?

Open the file with the cursor at the given line number.