For Absolute Beginners: This guide teaches you how to use GitHub Copilot to write your own bash scripts and customizations. No coding experience required—just follow along and learn by doing!
Before diving in, let's set honest expectations about what AI-assisted development looks like in practice.
| Metric | Value |
|---|---|
| Total development time | ~40-50 hours over 3.5 months |
| Git commits | 63 |
| Lines of bash code | ~2,100 |
| Lines of documentation | ~1,500 |
| Major rewrites | 3 (Cubic GUI → xorriso, dry-run removal, template sync) |
- Generates working code quickly — First drafts appear in seconds
- Explains unfamiliar concepts — Ask "why" and get clear answers
- Catches errors you'd miss — ShellCheck + Copilot finds bugs fast
- Handles boilerplate — Repetitive patterns are effortless
- Remembers context — No need to re-explain your project each session
- Understand your actual hardware — It doesn't know your radio setup
- Test in your environment — You still run and debug
- Make architectural decisions — You choose the approach
- Know upstream project internals — ETC's template system required research
- Guarantee correctness — AI confidently generates wrong code sometimes
- AI generates code (5 minutes)
- You test it (10 minutes)
- Something fails (always)
- You investigate (20 minutes)
- AI helps fix it (5 minutes)
- Repeat steps 2-5 (hours)
- Finally works (satisfaction!)
The honest truth: AI accelerates development 3-5x, but doesn't eliminate the learning curve. This project would have taken 150+ hours without Copilot, but it still took 40-50 hours with it.
If someone tells you AI writes perfect code on the first try, they're either lying or building something trivial.
This is NOT documentation for the emcomm-tools-customizer project—see README.md for that.
This guide teaches you how to use AI assistance (GitHub Copilot) to:
- Write bash scripts for any Linux customization
- Create configuration files for ham radio applications
- Manage sensitive data like WiFi passwords securely
- Document your work in Markdown
- Learn programming concepts through conversation with AI
The Goal: Empower you to create YOUR OWN customizations, not just use someone else's scripts.
- Google "how to configure WiFi on Ubuntu"
- Find 5 different tutorials, all slightly outdated
- Copy-paste commands you don't understand
- Something breaks, you have no idea why
- Start over with a different tutorial
- Ask: "Write a bash script to configure WiFi on Ubuntu 22.04"
- Copilot generates a complete script with explanations
- Ask: "Why does this use nmcli instead of editing files directly?"
- Copilot explains the reasoning
- Ask: "Add error handling and logging"
- Copilot updates the script
- You understand what you're running AND can modify it
Key Insight: Copilot is a teacher, not just a code generator. Ask "why" questions to learn, not just "how" questions.
- Go to GitHub and create a free account
- Enable GitHub Copilot in your account settings (free tier available)
- Free tier limits: 50 chat requests/month, 2,000 code completions/month
Download VS Code for your OS.
VS Code is a free code editor from Microsoft. Think of it as Notepad with superpowers—syntax highlighting, error checking, and AI assistance built in.
Open VS Code and install these extensions (click the Extensions icon in the left sidebar):
Required for Copilot:
Recommended for Bash Scripting:
- ShellCheck - Catches common bash errors
- Bash IDE - Syntax highlighting
Recommended for Documentation:
Optional but Useful:
- YAML - For config files
- Rainbow CSV - For data files
- Click the Accounts icon (bottom left of VS Code)
- Sign in with GitHub
- Copilot should activate automatically
-
Create a new file:
File → New File → Save As → configure-dark-mode.sh -
Open Copilot Chat: Click the Copilot icon in the sidebar (or
Cmd+Shift+I) -
Ask Copilot:
Write a bash script that enables dark mode on Ubuntu 22.04 using gsettings. Include comments explaining what each command does. -
Review the output: Copilot will generate something like:
#!/bin/bash # Enable dark mode on Ubuntu 22.04 # Set the color scheme to prefer dark gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' # Set the GTK theme to Yaru-dark gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-dark' echo "Dark mode enabled!"
-
Ask follow-up questions:
- "What does gsettings do?"
- "Will this persist after reboot?"
- "How do I make this work for all users, not just the current user?"
-
Iterate: Ask Copilot to add error handling, logging, or additional features.
The real power of Copilot is the conversation. Here are example prompts that help you LEARN, not just get code:
Explain what this command does: gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
What's the difference between using gsettings and editing dconf directly?
Which is better for a script that runs during ISO customization?
This script fails with "GSettings: command not found" - why?
What's the proper way to handle errors in a bash script?
Show me how to add logging that writes to a file.
Review this script for security issues. Are there any hardcoded secrets
or unsafe practices?
NEVER commit passwords, API keys, or other secrets to Git!
-
Create a template (
config.template.env):# WiFi Configuration WIFI_SSID="YOUR_NETWORK_NAME" WIFI_PASSWORD="YOUR_PASSWORD"
-
Create your actual secrets file (
config.env):# WiFi Configuration WIFI_SSID="MyHomeNetwork" WIFI_PASSWORD="SuperSecretPassword123"
-
Add to .gitignore:
config.env secrets.env *.env !*.template.env -
Use in your script:
#!/bin/bash source ./config.env # Now $WIFI_SSID and $WIFI_PASSWORD are available nmcli device wifi connect "$WIFI_SSID" password "$WIFI_PASSWORD"
Show me how to write a bash script that reads WiFi credentials from an
environment file and configures NetworkManager. The script should:
1. Check if the env file exists
2. Validate that required variables are set
3. Handle errors gracefully
Here are prompts for tasks you might want to automate. Copy these into Copilot Chat and modify for your needs.
Write a bash script that disables the on-screen keyboard accessibility
feature, disables the screen reader, and sets the hostname to a value
from an environment variable. Include error handling and logging.
Write a bash script that creates a direwolf.conf file for APRS.
The script should read callsign and SSID from environment variables.
Use a heredoc to create the config file.
Write a bash script that installs a list of packages on Ubuntu.
The script should:
- Check if each package is already installed
- Only install missing packages
- Handle apt errors gracefully
- Log what was installed
Write a bash script that backs up a directory before making changes.
Create a timestamped backup, then apply modifications.
If anything fails, restore from backup.
Good documentation helps you remember what you did and helps others learn.
Generate a README.md for this script. Include:
- What the script does
- Prerequisites
- How to configure it
- Example usage
- Troubleshooting tips
# Heading 1
## Heading 2
**Bold text** and *italic text*
- Bullet point
- Another point
1. Numbered list
2. Second item
`inline code`
```bash
code block
```
[Link text](https://example.com)❌ "Write a WiFi script"
✅ "Write a bash script for Ubuntu 22.04 that configures WiFi using NetworkManager. Read SSID and password from environment variables. Include error handling for cases where the network isn't found."
Don't try to build everything at once:
- Start with the basic functionality
- Add error handling
- Add logging
- Add configuration options
- Add documentation
- "Why did you use
set -euo pipefailat the start?" - "Why use
nmcliinstead ofiwconfig?" - "What happens if this command fails?"
Copilot is helpful but not infallible:
- Use ShellCheck to catch syntax errors
- Test in a VM or container first
- Read the code before running it
- Ask Copilot to explain anything you don't understand
GitHub Copilot gives you access to multiple AI models, each with different strengths. Choosing the right model for the task can dramatically improve your results.
| Model | Speed | Best For | Quota Cost |
|---|---|---|---|
| GPT-4o | Fast | Quick code generation, simple edits | Low |
| GPT-4.1 | Fast | General coding, good balance | Low |
| Claude 3.5 Haiku | Very Fast | Simple tasks, high volume | Very Low |
| Claude 3.5 Sonnet | Medium | Complex reasoning, longer context | Medium |
| Claude Sonnet 4 | Medium | Best explanations, nuanced analysis | Medium |
| Claude Opus 4 | Slow | Most capable, complex projects | High |
| o1 | Slow | Difficult algorithms, multi-step logic | High |
| o3-mini | Medium | Math, logic puzzles, reasoning | Medium |
Anthropic's Claude models come in three tiers—think of them as good/better/best:
Claude Haiku (3.5 Haiku):
- Fastest and cheapest Claude model
- Great for simple, repetitive tasks
- Use when: You need quick answers and speed matters more than depth
- Example: "What's the syntax for a bash if statement?"
Claude Sonnet (3.5 Sonnet, Sonnet 4):
- Best balance of speed, capability, and cost
- Excellent for most coding tasks
- Use when: You need thoughtful, well-explained answers
- Example: "Review this script for security issues and explain each problem"
Claude Opus (Opus 4):
- Most capable model in the Claude family
- Best for complex, nuanced tasks requiring deep understanding
- Use when: Sonnet isn't giving good enough answers, or for critical code
- Example: "Architect a complete solution for managing radio CAT control across multiple applications with proper error handling and logging"
For Simple Tasks (use GPT-4o, GPT-4.1, or Claude Haiku):
- Writing basic bash scripts
- Simple code completions
- Quick syntax fixes
- Straightforward "how do I..." questions
For Complex Tasks (use Claude Sonnet 4):
- Understanding large codebases
- Explaining complex concepts
- Writing documentation
- Code review and security analysis
- Multi-file refactoring
- When you need nuanced, thoughtful responses
For the Most Demanding Tasks (use Claude Opus 4):
- Architecting complete solutions from scratch
- Critical code that must be correct (safety, security)
- Complex multi-component system design
- When Sonnet's answers aren't quite right
- Tasks requiring deep domain expertise
For Reasoning-Heavy Tasks (use o1 or o3-mini):
- Complex algorithms
- Debugging subtle logic errors
- Multi-step problem solving
- When simpler models give wrong answers
- Mathematical or logical puzzles
In VS Code with Copilot Chat:
- Click the model name in the chat input area
- Select from the available models
- Your next message will use that model
Tip: Start with a fast model (GPT-4o), and if the answer isn't good enough, retry with Claude or o1.
Simple script generation → GPT-4o:
Write a bash function that checks if a file exists
Understanding unfamiliar code → Claude Sonnet 4:
Explain what this direwolf.conf file does and what each section means.
I'm new to packet radio and need to understand how to configure it.
Debugging complex logic → o1:
This script should detect all USB serial devices and match them to
known radio models, but it's failing for devices with multiple interfaces.
Help me fix the device enumeration logic.
The "reasoning" models (o1, o3-mini) and Opus use significantly more of your quota:
- A single o1 query might use 5-10x the tokens of a GPT-4o query
- Claude Opus uses roughly 3-5x more than Sonnet
- Claude Haiku is the most economical choice for simple tasks
- On the free tier, this matters—use premium models sparingly
- For most bash scripting tasks, GPT-4o or Claude Sonnet is sufficient
For ham radio/EmComm scripting:
- Default to Claude Sonnet 4 for most questions—it gives better explanations and catches edge cases
- Use GPT-4o or Claude Haiku for quick code completions while typing
- Escalate to Claude Opus for complex architecture or critical code
- Save o1 for when you're truly stuck on a logic problem
- Try multiple models if the first answer doesn't work
GitHub Copilot Free includes:
- 50 chat messages per month
- 2,000 code completions per month
Tips to stay within limits:
- Ask comprehensive questions (get more in fewer messages)
- Use code completions (typing and accepting suggestions) more than chat
- Consider upgrading to Pro ($10/month) if you use it regularly
- Use Copilot as a teacher, not just a code generator
- Ask "why" questions to understand, not just "how" questions
- Start small and iterate
- Test everything before deploying
- Never commit secrets to public repositories
- Document your work so you remember why you made each choice
- Share your knowledge to help the ham radio community
- EmComm Tools Community: TheTechPrepper
- GitHub Copilot: GitHub
- This Guide: KD7DGF
73 de KD7DGF 📻