
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
@aigne/example-afs-system-fs
Advanced tools
A demonstration of using AIGNE Framework with AFS SystemFS module
This example demonstrates how to create a chatbot that can interact with your local file system using the AIGNE Framework and AIGNE CLI. The example utilizes the SystemFS module to provide file system access to AI agents through the AFS (AIGNE File System) interface.
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY # Set your OpenAI API key
# Mount your current directory and chat with the bot about your files
npx -y @aigne/example-afs-system-fs --path . --chat
# Mount a specific directory (e.g., your documents)
npx -y @aigne/example-afs-system-fs --path ~/Documents --mount /docs --description "My Documents" --chat
# Ask questions about files without interactive mode
npx -y @aigne/example-afs-system-fs --path . --input "What files are in the current directory?"
git clone https://github.com/AIGNE-io/aigne-framework
cd aigne-framework/examples/afs-system-fs
pnpm install
Setup your OpenAI API key in the .env.local file:
OPENAI_API_KEY="" # Set your OpenAI API key here
You can use different AI models by setting the MODEL environment variable along with the corresponding API key. The framework supports multiple providers:
MODEL="openai:gpt-4.1" with OPENAI_API_KEYMODEL="anthropic:claude-3-7-sonnet-latest" with ANTHROPIC_API_KEYMODEL="gemini:gemini-2.0-flash" with GEMINI_API_KEYMODEL="bedrock:us.amazon.nova-premier-v1:0" with AWS credentialsMODEL="deepseek:deepseek-chat" with DEEPSEEK_API_KEYMODEL="openrouter:openai/gpt-4o" with OPEN_ROUTER_API_KEYMODEL="xai:grok-2-latest" with XAI_API_KEYMODEL="ollama:llama3.2" with OLLAMA_DEFAULT_BASE_URLFor detailed configuration examples, please refer to the .env.local.example file in this directory.
# Run with your current directory
pnpm start --path .
# Run with a specific directory and custom mount point
pnpm start --path ~/Documents --mount /docs --description "My Documents"
# Run in interactive chat mode
pnpm start --path . --chat
This example uses the SystemFS module from @aigne/afs-system-fs to mount your local file system into the AFS (AIGNE File System). This allows AI agents to interact with your files through a standardized interface.
The SystemFS module provides these AFS operations:
// List files in root directory
await systemFS.list("")
// List files recursively with depth limit
await systemFS.list("", { recursive: true, maxDepth: 2 })
// List with sorting and limits
await systemFS.list("", {
orderBy: [['path', 'asc']],
limit: 10
})
// Read file content
const file = await systemFS.read("README.md")
console.log(file.content) // File contents as string
// Read directory metadata
const dir = await systemFS.read("src")
console.log(dir.metadata.type) // "directory"
// Write a text file
await systemFS.write("notes.txt", {
content: "My notes",
summary: "Personal notes file"
})
// Write JSON data
await systemFS.write("config.json", {
content: { setting: "value" },
metadata: { format: "json" }
})
// Search for text in files
const results = await systemFS.search("", "TODO")
// Search with regex patterns
const matches = await systemFS.search("", "function\\s+\\w+")
// Limit search results
const limited = await systemFS.search("", "error", { limit: 5 })
Try these commands to explore the file system capabilities:
# List all files in current directory
npx -y @aigne/example-afs-system-fs --path . --input "List all files in the root directory"
# Read a specific file
npx -y @aigne/example-afs-system-fs --path . --input "Read the contents of package.json"
# Search for specific content
npx -y @aigne/example-afs-system-fs --path . --input "Find all files containing the word 'example'"
# Start interactive mode
npx -y @aigne/example-afs-system-fs --path . --chat
Then try asking:
# Mount multiple directories or specific paths
npx -y @aigne/example-afs-system-fs --path ~/Projects --mount /projects --description "My coding projects" --chat
The chatbot can help you navigate, search, read, and organize files in your mounted directories through natural language commands.
FAQs
A demonstration of using AIGNE Framework with AFS SystemFS module
The npm package @aigne/example-afs-system-fs receives a total of 35 weekly downloads. As such, @aigne/example-afs-system-fs popularity was classified as not popular.
We found that @aigne/example-afs-system-fs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.