Your First 5 Minutes
🚀 Your First 5 Minutes with Sierra DevLink
Build your first investigation tool from scratch in 5 minutes!
What You'll Learn
- Create a working invoker
- Compile it to a standalone tool
- Run it and see formatted results
- Understand the complete workflow
🎯 The GoalLink
We're building url_analyzer - a simple tool that:
- Takes a URL as input
- Extracts basic information
- Displays results in a table
Step 1: Create Environment (30 seconds)Link
Make sure Sierra Dev is installed first!
If you haven't installed it yet, see the Installation Guide.
Open your terminal and run:
✅ You now have:
Step 2: Write Your First Invoker (2 minutes)Link
Create a new file scripts/url_analyzer.py:
Let's break down each part:
1. Import and Define
| Python | |
|---|---|
2. Helper Function (Optional)
| Python | |
|---|---|
@invoker.dependancy
- Can be reused by other functions
- Gets included in compilation
3. Entry Point (Required)
| Python | |
|---|---|
run
- Marked with @invoker.entry_point
- Parameters use sierra.Param for validation
- Must call sierra.respond(result) at the end
4. Loader (Required)
- Registers your invoker with Sierra - Required for discoveryStep 3: Build (Compile) Your Invoker (30 seconds)Link
This converts your source code into a standalone tool:
| Bash | |
|---|---|
What happens:
graph LR
A[scripts/url_analyzer.py] -->|Read| B[Validate]
B -->|Transform| C[Generate CLI]
C -->|Write| D[invokers/url_analyzer.py]
style A fill:#bc13fe20
style D fill:#00f3ff20
✅ Look for this output:
| Text Only | |
|---|---|
Step 4: Test Your Tool (1 minute)Link
Now let's run it!
Get HelpLink
| Bash | |
|---|---|
Output:
| Text Only | |
|---|---|
Run It!Link
| Bash | |
|---|---|
Output (JSON):
| JSON | |
|---|---|
🎉 Congratulations! You just created your first Sierra invoker!
🎓 What You LearnedLink
| Concept | What It Is | Example |
|---|---|---|
| Invoker | A structured tool | url_analyzer |
| Helper Function | Reusable logic | analyze_url() |
| Entry Point | Main execution | run() function |
| Parameter | Input with validation | url parameter |
| Result | Formatted output | sierra.Table |
| Compilation | Source → Standalone | scripts/ → invokers/ |
🚀 Next StepsLink
Level Up Your SkillsLink
Try enhancing url_analyzer:
| Python | |
|---|---|
Rebuild and test:
| Bash | |
|---|---|
Instead of sierra.Table, try:
Tree Result:
| Python | |
|---|---|
Error Result:
| Python | |
|---|---|
Deep Dive DocumentationLink
| Topic | Where to Go |
|---|---|
| Understand the concepts | Core Concepts |
| Master CLI commands | CLI Reference |
| Learn result types | Results Guide |
| Use packages | Package Manager |
| Advanced techniques | Development Guide |
💡 TroubleshootingLink
Build failed with validation errors
Common causes:
- ❌ Invoker name has hyphens → Use underscores
- ❌ Missing type annotations → Add
: str, etc. - ❌ No entry point → Add
@invoker.entry_point
Run with --verbose for details:
| Bash | |
|---|---|
ImportError: No module named 'sierra'
Solution: Make sure virtual environment is activated
How do I modify the invoker?
- Edit
scripts/url_analyzer.py - Run
sierra-dev build --env my_first_projectagain - Test the
invokers/url_analyzer.pyversion
🎯 Challenge Yourself!Link
Ready to practice? Try building these:
🔰 BeginnerLink
- Email Validator - Check if an email format is valid
- File Size Analyzer - Show file sizes in a directory
⭐ IntermediateLink
- IP Lookup - Get geolocation from IP address
- Hash Generator - Generate MD5/SHA256 hashes
💎 AdvancedLink
- Port Scanner - Scan common ports on a target
- DNS Resolver - Query DNS records
🚀 You're now a Sierra Dev developer!