agentignore 0.4.1

FUSE filesystem that hides files matching .agentignore rules from processes - control what agents can see while building apps
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! `agentignore init` — Create example `.agentignore` and `.agentallow` files.

use crate::cmd::common::{write_agentallow, write_agentignore};
use std::path::PathBuf;

/// Handle `agentignore init [folder]`.
///
/// Creates example `.agentignore` and `.agentallow` files in the specified
/// directory (or the current directory if none is given).
pub fn init(folder: Option<PathBuf>) {
    let dir = folder.unwrap_or_else(|| std::env::current_dir().unwrap());
    std::fs::create_dir_all(&dir).expect("failed to create directory");

    write_agentignore(&dir);
    write_agentallow(&dir);

    println!("✓ Created .agentignore and .agentallow in {:?}", dir);
}