layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[Blog] Write a blog post on how to configure Gemini CLI for trusted directories

Open yi-nuo426 opened this issue 11 months ago • 2 comments

Contributors and community members are encouraged to post on https://layer5.io/blog. A new blog post fitting the following description is requested to be written by a community member:

Desired Title: gemini cli how to add trusted directories Topic: Gemini CLI Configuration to avoid wasted time having to approve prompts.

Trusted directories can be added in the Gemini CLI through interactive prompts, commands, or by manually editing the configuration file.

Interactive Prompts The CLI can prompt for trust settings.

When running the Gemini CLI in a new, untrusted folder, a dialog will appear.

Select Trust folder to trust the current directory. Select Trust parent folder to trust the current folder and all subdirectories.

To change the trust level for the current folder, run the /permissions command from within that directory to bring up the interactive dialog.

Commands for Multi-Directory Support

To give the CLI access to multiple directories, use the /directory command or the --include-directories flag. To start a session with multiple directories:

gemini --include-directories path/to/dir1,path/to/dir2

Paths can be absolute or relative.

To add a new directory during an active session:

/directory add <path>

Multiple paths can be added, separated by commas.

To view all active directories:

/directory show

The alias /dir also works for these commands.

Manually Editing the Configuration File

Trusted folder rules are stored in a JSON file, which can be inspected or edited manually. The file is located at ~/.gemini/trustedFolders.json in the home directory.

Edit this file directly to add or remove paths. Changes should take effect after restarting the CLI session.


Contributor Resources

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

yi-nuo426 avatar Dec 28 '25 02:12 yi-nuo426

Hi! I’d love to take this up and write the blog post on configuring Gemini CLI trusted directories.
Please assign this issue to me — happy to submit a PR soon 😊

Abhra0404 avatar Jan 10 '26 14:01 Abhra0404

This is already done: "Streamline Your Gemini CLI Workflow with Trusted Directories" is published at https://layer5.io/blog/ai/streamline-your-gemini-cli-workflow-with-trusted-directories/ and follows the requested outline. Closing as complete.

yi-nuo426 avatar Nov 01 '26 04:11 yi-nuo426