Intent-Based Coding - Demo Tool

Use AI tools to build fully-functional automation scripts
Info Bar: Links to help you crush your demos!

๐Ÿ“ Field Notes: Code on the shoulders of giants

Priming your LLM

Use this prompt at the beginning of your LLM session to help your digital agent write better code:

Your persona will be a senior software developer with experience in PowerShell, Python, VBA, JavaScript, and PHP.
I need your help creating scripts and other code snippets across these programming languages.
I will give you a file or other instructions with the requirements and I want you to create the code.
Focus on creating clean code and don't create any other extraneous artifacts, like readme files or sample input files.
Your code will be used by real network pros that are grinding it out every day, so it must be production-ready.
You can use whatever tools you have at your disposal.
If you need clarification about a requirement or a goal, ask questions before you start coding.
Your goal is to nail the artifact on the FIRST PASS.
Keep your responses brief but informative, and humor is always appreciated.
Copied! โœ“

Maximizing intent and minimizing ambiguity

When writing code requirements, here's some tips to convey clear intent and avoid ambiguity:

  • Use explicit language- Ex: Use X, not Y instead of just specifying X
  • Explain the reasoning- Ex: Use IP address to avoid DNS resolution issues
  • Be specific about data usage- Ex: The hostname field is only for display; the IP field is for pinging
  • Use examples whenever possible- Ex: Use the string "Hostname (IP address) is up and running!" for ping success message
  • Number your sub-requirements- Ex: Break complex items into 5a, 5b, 5c if needed

โš”๏ธ PowerShell vs Python: When and where to use them

PowerShell Advantages

  • Native to Windows - Already installed, no setup needed
  • Windows integration - Deep access to Windows systems and Active Directory
  • Network admin culture - Used by most Windows IT shops
  • Built-in cmdlets - Test-Connection works out of the box, no libraries
  • Ideal for Windows-only environments

Python Advantages

  • Cross-platform - Same script runs on Windows, Linux, macOS
  • Larger ecosystem - Massive library support for APIs, data analysis, web scraping
  • More versatile - Better for complex automation, machine learning, web apps
  • Career value - Python skills transfer to more domains (data science, AI, web dev)
  • Better for full-stack apps - Easier to build REST APIs and web interfaces
โš–๏ธ Bottom Line: PowerShell rises like the Phoenix for Windows tasks while Python can devour cross-platform and full-stack web app tasks.

What You'll Build

๐Ÿฆโ€๐Ÿ”ฅ

PowerShell Scripts

Create monitoring tools with color-coded output and continuous loops

๐Ÿ

Python Scripts

Build cross-platform scripts that run on Windows, Linux, and macOS

๐Ÿฆ

Excel Macros

Turn your spreadsheets into device management launchpads

๐Ÿ 

Web Hooks

Enable one-click access to devices directly from your browser

What You'll Learn

๐Ÿ’ก Intent-Based Coding

Move from thinking about "how" to thinking about "what's the goal?" and let AI generate the code.

๐Ÿšง Cross-Platform Skills

Build scripts that work anywhereโ€”Windows, Linux, macOSโ€”without rewriting code.

๐Ÿงฉ Tool Integration

Chain multiple tools together into unified workflows that eliminate manual steps.

๐Ÿ’ซ Full-Stack Thinking

Connect web apps, CLIs, and desktop toolsโ€”build complete automation solutions.

๐ŸŒ Real-World Techniques

Learn the same techniques enterprise automation platforms use in production.

๐Ÿ’ฐ Immediate ROI

Walk away with working code you can use in your environment today.

What You'll Need

Access to an LLM - Claude, Gemini, Grok, etc.

Network device you can ping, SSH to, and access via SFTP and HTTP

Windows command-line access (PowerShell and Python demos)

Microsoft Excel with macros enabled (Excel Macro demo)

PuTTY and FileZilla (free version) (Excel Macro and Web Hooks demo)

Admin access to Windows Registry (Web Hooks demo)

Getting Started is as easy as 1-2-3

1

Read the Intent-Based Automation FAQs

Click the ๐Ÿ”ฎ icon in the Info Bar to learn more about Intent-Based Automation and why it matters for your career.

2

Get the LLM Priming Prompt

Click the ๐Ÿ“ icon in the Info Bar to copy the LLM priming promptโ€”it will help your LLM generate better code for these demos.

3

Pick a Demo and Start Building

Follow the detailed notes and you'll have working code in a few minutes. Click the Easy Button to bypass the LLM and use pre-built code.

๐Ÿ”ฎ From CLI to Intent-Based Coding: Automate your way to a better future!

What is Intent-Based Automation?

Intent-Based Automation refers to the use of AI and ML to automate the management and operation of network infrastructure. Unlike traditional network automation, which relies on manual scripting, Intent-Based Automation uses intelligent, self-optimizing systems that can adapt and make decisions in real time.

Why should I learn these skills and tools now?

Someone has to build and support Intent-Based Automation solutions, so Network Architects that embrace the tech now will become:

1. More marketable by having the skills needed to deliver and support Intent-Based Automation.

2. Trusted advisors to clients and prospects that are moving to Intent-Based Automation.

3. More productive as intent-based coding becomes part of their DNA.

Do I need to learn programming?

You don't need to become a hard-core developer, but you'll have to learn to use the tools that generate code, and you'll need to learn to read code well enough to make changes to code snippets.

That sounds intimidating but also exciting. How do I get started?

As a Network Architect, you already understand the network concepts and protocols needed for Intent-Based Automation. Your focus should be on shifting your mindset toward a more programmatic, data-centric model and leveraging automation tools that minimize the need for hands-on coding.

Five things you can start doing to get prepared for Intent-Based Automation:

1. Master "intent-based" coding and DevOps principles

Intelligent automation isn't about automating a single, repetitive task; it's about defining the desired state or "intent" for the entire network and letting the automation platform figure out how to get there.

2. Get familiar with no-code and low-code automation tools

You don't need to be a Python expert to start automating. A new generation of tools allows you to build and manage workflows with a visual, prompt-based, drag-and-drop interfaces.

3. Learn to use APIs

Intent-Based Automation is API-driven. APIs are how software components communicate with each other. As a Network Architect, you must understand how to interact with them, but not necessarily build them.

4. Develop your analytics and AI literacy

Intelligent automation relies on data analytics and AI to optimize networks and predict issues. Your role will evolve from fixing problems to using data insights to prevent them.

5. Build and practice in a demo environment

The best way to get practical experience is by building your own automations. This allows you to experiment freely without risking your production network.

๐Ÿ† Be Bold! Use these demos to shift your mindset. Push yourself. Don't be afraid to break things. It's only code. You got this!

๐Ÿฆโ€๐Ÿ”ฅ PowerShell Script Demo: Create on-demand device automations

What this demonstrates:

Shows how to use an intent-based approach when creating monitoring tools with user input, color-coded output, and continuous monitoring capabilities.

Skills demonstrated:

  • Creating interactive command-line tools without coding
  • Creating input files and reading data from external sources
  • Developing a Loop-based automation script with visual feedback
PowerShell Demo Steps:
  • 1 โ†’ Copy the prompt below and paste it into your LLM of choice
  • 2 โ†’ Download or Copy the LLM output and save the file to a local directory as demo.ps1
  • 3 โ†’ Create a device file called sites.txt using the format: hostname,ip_address (one per line) in the same directory
  • 4 โ†’ Open a Command Prompt in the same directory and run: powershell -file demo.ps1
  • โš ๏ธ If you get a security error, run: powershell -ExecutionPolicy Bypass -File demo.ps1
  •  

    ๐Ÿ’ก Pro Tip: Click the โš”๏ธ icon in the Info Bar for tips on when to use PowerShell over Python

๐ŸŽฏ PowerShell Script Prompt

Create a PowerShell script that meets these requirements:
1. Clear the terminal once only: before displaying the initial user prompts
2. Read a file named sites.txt from the current directory
3. The file format is CSV-style with hostname and IP on each line: "hostname,192.168.1.1"
4. Prompt the user at launch for the number of cycles to run and the interval in seconds between cycles
5. Display a cycle counter before each cycle runs
6. Ping each device once using Test-Connection
7. Display results line-by-line on screen showing the hostname and IP address
8. Use color-coding: green text for successful pings, red text for failed pings
9. Play a console beep sound only when a device fails the ping test
10. Wait the specified interval between cycles and repeat for the specified number of cycles
11. Name the output file demo.ps1
Copied! โœ“

โœจ Generated PowerShell Script

Clear-Host

# Prompt for user input
$cycles = Read-Host "Enter number of cycles"
$interval = Read-Host "Enter interval in seconds"

# Validate input
if (-not ($cycles -as [int]) -or -not ($interval -as [int])) {
    Write-Host "Invalid input. Please enter whole numbers." -ForegroundColor Red
    exit
}

$cycles = [int]$cycles
$interval = [int]$interval

# Check if sites.txt exists
if (-not (Test-Path "sites.txt")) {
    Write-Host "Error: sites.txt not found in current directory." -ForegroundColor Red
    exit
}

# Read and parse the sites file
$sites = @()
try {
    Get-Content "sites.txt" | ForEach-Object {
        if ($_ -match '^\s*$') { return }  # Skip empty lines
        $parts = $_ -split ','
        if ($parts.Count -eq 2) {
            $sites += @{
                Hostname = $parts[0].Trim()
                IP       = $parts[1].Trim()
            }
        }
    }
} catch {
    Write-Host "Error reading sites.txt: $_" -ForegroundColor Red
    exit
}

if ($sites.Count -eq 0) {
    Write-Host "No valid entries found in sites.txt" -ForegroundColor Red
    exit
}

# Main monitoring loop
for ($c = 1; $c -le $cycles; $c++) {
    Write-Host "`n--- Cycle $c ---" -ForegroundColor Cyan
    
    foreach ($site in $sites) {
        $ping = Test-Connection -ComputerName $site.IP -Count 1 -Quiet
        
        if ($ping) {
            Write-Host "$($site.Hostname) - $($site.IP)" -ForegroundColor Green
        } else {
            Write-Host "$($site.Hostname) - $($site.IP)" -ForegroundColor Red
            [System.Console]::Beep()
        }
    }
    
    if ($c -lt $cycles) {
        Start-Sleep -Seconds $interval
    }
}

Write-Host "`nMonitoring complete." -ForegroundColor Cyan
Copied! โœ“

๐Ÿ Python Script Demo: Create cross-platform device automations

What this demonstrates:

Shows how an intent-based prompt can create a Python script with cross-platform capabilities (Windows, Linux, macOS).

Skills demonstrated:

  • Adapting prompts for different scripting languages
  • Working with external libraries (colorama)
  • Creating platform-agnostics automation without manually writing code
Python Demo Steps:
  • 1 โ†’ Copy the prompt below and paste it into your LLM of choice
  • 2 โ†’ Download or Copy the LLM output and save the file to a local directory as demo.py
  • 3 โ†’ Create a device file called sites.txt using the format: hostname,ip_address (one per line) in the same directory
  • 4 โ†’ If needed, open a Command Prompt and install colorama: pip install colorama
  • 5 โ†’ Open a Command Prompt in the same directory and run: python3 demo.py
  •  

    ๐Ÿ’ก Pro Tip: Click the โš”๏ธ icon in the Info Bar for info on when to use Python over PowerShell

๐ŸŽฏ Python Script Prompt

Create a Python script that meets the following requirements:
1. Clear the terminal before displaying the initial user prompts
2. Read a file named sites.txt from the current directory
3. The file format is CSV-style with hostname and IP on each line: "hostname,192.168.1.1"
4. Prompt the user at launch for the number of cycles to run and the interval in seconds between cycles
5. Displays a cycle counter before each cycle runs
6. Ping each device once using subprocess to execute ping commands
7. Use the IP address field (second column) for pinging to avoid DNS resolution issues
8. Use the hostname field (first column) for display purposes in the results
9. Display results line-by-line on screen showing the hostname and the IP address
10. Uses color-coding: green text for successful pings, red text for failed pings (use colorama library)
11. Play a console beep sound only when a device fails the ping test
12. Wait the specified interval between cycles and repeat for the specified number of cycles
13. Make the script cross-platform compatible (Windows, Linux, macOS)
14. Name the output file demo.py
Copied! โœ“

โœจ Generated Python Script

import os
import sys
import subprocess
import time
from colorama import init, Fore

# Initialize colorama for cross-platform color support
init(autoreset=True)

def clear_terminal():
    """Clear the terminal screen"""
    os.system('cls' if os.name == 'nt' else 'clear')

def get_ping_command(ip):
    """Return platform-specific ping command"""
    if sys.platform == 'win32':
        return ['ping', '-n', '1', ip]
    else:
        return ['ping', '-c', '1', ip]

def ping_device(ip):
    """Ping a device and return True if successful, False otherwise"""
    try:
        cmd = get_ping_command(ip)
        result = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=5)
        return result.returncode == 0
    except Exception:
        return False

def load_devices(filename):
    """Load devices from CSV file"""
    if not os.path.exists(filename):
        print(f"{Fore.RED}Error: {filename} not found in current directory")
        sys.exit(1)
    
    devices = []
    try:
        with open(filename, 'r') as f:
            for line in f:
                line = line.strip()
                if not line:
                    continue
                parts = line.split(',')
                if len(parts) == 2:
                    devices.append({
                        'hostname': parts[0].strip(),
                        'ip': parts[1].strip()
                    })
    except Exception as e:
        print(f"{Fore.RED}Error reading {filename}: {e}")
        sys.exit(1)
    
    if not devices:
        print(f"{Fore.RED}Error: No valid devices found in {filename}")
        sys.exit(1)
    
    return devices

def get_positive_int(prompt, min_value=1):
    """Prompt user for positive integer input with validation"""
    while True:
        try:
            value = int(input(prompt))
            if value >= min_value:
                return value
            print(f"{Fore.RED}Error: Value must be at least {min_value}")
        except ValueError:
            print(f"{Fore.RED}Error: Please enter a valid integer")

def main():
    clear_terminal()
    
    # Load devices from CSV
    devices = load_devices('sites.txt')
    
    # Get user input
    cycles = get_positive_int("Enter number of cycles: ")
    interval = get_positive_int("Enter interval in seconds between cycles: ", min_value=0)
    
    # Run ping cycles
    for cycle in range(1, cycles + 1):
        print(f"\n{Fore.CYAN}Cycle {cycle}\n")
        
        for device in devices:
            hostname = device['hostname']
            ip = device['ip']
            
            if ping_device(ip):
                print(f"{Fore.GREEN}{hostname} ({ip}) - SUCCESS")
            else:
                print(f"{Fore.RED}{hostname} ({ip}) - FAILED")
                print('\a', end='', flush=True)  # Cross-platform beep
        
        # Wait before next cycle (skip on last cycle)
        if cycle < cycles:
            time.sleep(interval)
    
    print(f"\n{Fore.CYAN}Ping cycles complete.")

if __name__ == '__main__':
    main()
Copied! โœ“

๐Ÿฆ Excel Macro Demo: Create a device management launchpad

What this demonstrates:

Shows how an intent-based approach to writing VBA macros can create seamless application integrations.

Skills demonstrated:

  • Using AI to generate working code from plain English input
  • Integrating command-line tools and other applications with Office applications
  • How to use automation to eliminate mundane and repetitive tasks
Generated Macro Install Steps:
  • 1 โ†’ Download the Demo Spreadsheet below
  • 2 โ†’ Download the prompt(s) below and load them into your LLM
  • 3 โ†’ Copy the LLM output, open your spreadsheet and Press Alt-F11 to bring up the VBA window
  • 4 โ†’ Select Import โ†’ Module โ†’ Paste the LLM output โ†’ Close Window(s)
  • 5 โ†’ GoTo Developer Menu: Select Insert โ†’ Button
  • 6 โ†’ Draw a Button โ†’ Select "filename" from pop-up window โ†’ Save
  • 7 โ†’ Right click the new button to change the name and format as desired
  •  

    Pre-built Macro Install Steps:
  • 1 โ†’ Download the Demo Spreadsheet below
  • 2 โ†’ Download the desired macro(s) below
  • 3 โ†’ Open your spreadsheet and Press Alt-F11 to bring up the VBA window
  • 4 โ†’ Select File โ†’ Import โ†’ "filename"
  • 5 โ†’ GoTo Developer Menu: Select Insert โ†’ Button
  • 6 โ†’ Draw a Button โ†’ Select "filename" from pop-up window โ†’ Save
  • 7 โ†’ Right click the new button to change the name and format as desired
  •  

    ๐Ÿ’ก Pro Tip: Match the Hostname in your own Excel sheet with a PuTTY Session or FileZilla Site then try using those macros to connect to your devices.

โฌ‡๏ธ Download Excel Files (Spreadsheet - Prompts - Macros)

๐ŸŽฏ Ping Macro Prompt

Write an Excel VBA macro that meets the following requirements:
1. Run a Windows Ping command (single ping, hidden window) using the IP Address in the active row
2. Check the ping exit code to determine success or failure
3. Use Column A to retrieve the Hostname of the device
4. Use Column C to retrieve the IP address of the device
5. If column C is empty or contains an invalid IP address, display an error message
6. Allow any column to be the active column in the active row
7. Include the Hostname and IP address in the message
8. When a Ping test succeeds, display a message box saying "Hostname (IP Address) is crushing it!" 
9. When a Ping test fails, display a message box saying "Hostname (IP Address) is not feeling well!"
10. When a Ping test fails, play a console beep.
Copied! โœ“

โœจ Generated Ping Macro

Sub PingDevice()
    Dim ws As Worksheet
    Dim activeRow As Long
    Dim hostname As String
    Dim ipAddress As String
    Dim shell As Object
    Dim exitCode As Long
    
    Set ws = ActiveSheet
    activeRow = ActiveCell.Row
    
    ' Get hostname from Column A and IP from Column C
    hostname = ws.Cells(activeRow, 1).Value
    ipAddress = ws.Cells(activeRow, 3).Value
    
    ' Validate inputs
    If Len(hostname) = 0 Or Len(ipAddress) = 0 Then
        MsgBox "Error: Hostname or IP address is missing.", vbExclamation, "Missing Data"
        Exit Sub
    End If
    
    ' Validate IP address format
    If Not IsValidIP(ipAddress) Then
        MsgBox "Error: Invalid IP address format.", vbExclamation, "Invalid IP"
        Exit Sub
    End If
    
    ' Execute ping command (hidden window, single ping)
    Set shell = CreateObject("WScript.Shell")
    exitCode = shell.Run("ping -n 1 " & ipAddress, 0, True)
    
    ' Check result and display message
    If exitCode = 0 Then
        MsgBox hostname & " (" & ipAddress & ") is crushing it!", vbInformation, "Ping Success"
    Else
        MsgBox hostname & " (" & ipAddress & ") is not feeling well!", vbExclamation, "Ping Failed"
        Beep
    End If
    
    Set shell = Nothing
End Sub

Function IsValidIP(ip As String) As Boolean
    Dim parts() As String
    Dim i As Integer
    Dim part As String
    
    ' Validate IP format: 4 octets separated by dots
    parts = Split(ip, ".")
    
    If UBound(parts) <> 3 Then
        IsValidIP = False
        Exit Function
    End If
    
    For i = 0 To 3
        part = parts(i)
        If Len(part) = 0 Or Not IsNumeric(part) Then
            IsValidIP = False
            Exit Function
        End If
        If Val(part) < 0 Or Val(part) > 255 Then
            IsValidIP = False
            Exit Function
        End If
    Next i
    
    IsValidIP = True
End Function

Function IsNumeric(value As String) As Boolean
    On Error Resume Next
    IsNumeric = Not IsNull(CDbl(value))
    On Error GoTo 0
End Function
Copied! โœ“

๐Ÿ  Web Hook Demo: Enable one-click device access from the browser

Web Hook Overview

Web Hooks (aka Protocol Handlers) are mini-APIs that can launch applications directly from web links. Instead of manually opening programs and typing IP addresses or session info, you can click a link and connect seamlessly to any device.

For example:

  • Click ๐Ÿ›œ โ†’ Windows pings the device
  • Click ๐Ÿ›ก๏ธ โ†’ PuTTY opens an SSH session
  • Click ๐Ÿ” โ†’ FileZilla connects via SFTP

This one-click capability is a huge time saver and a much better user experience.

๐Ÿšจ Developing Web Hooks typically requires iteration and testing, so trying to create them with a single LLM prompt is beyond the scope of this demo. Instead, you'll walk through downloading, installing, and testing pre-built Web Hooks. At the end, you'll experience the ease and efficiency of launching external programs without leaving your browser.

How They Work

Web Hooks use Windows Registry entries to map custom URL schemes (like ping-ip://) to executable commands. When you click a link with a custom URL, Windows executes the associated command and passes the IP address automagically.

The workflow:

  • Web page contains: <a href="ping-ip://192.168.1.1">Ping Device</a>
  • User clicks the link
  • Windows looks up the ping-ip:// web hook in the registry
  • Executes the associated command (PowerShell script that runs ping)
  • CMD window opens showing ping results
๐Ÿ“„ Web Hook Installation Notes:
  • โ€ข PuTTY and FileZilla must be installed in the default directories to use the supplied .reg files as-is
  • โ€ข You need administrator privileges to modify the Windows Registry
  • โ€ข Modern browsers may show a confirmation dialog when launching new web hooks
  •  

    ๐Ÿ’ก Pro Tip: The Windows Registry contains a vast amount of critical system information, so make your new entries easy to find by adding them as Favorites.

๐Ÿ“‹ Installation Instructions

Step 1: Download the Registry Files

Click the download buttons below to save the .reg files. Each file is generated on-the-fly by your browser - no external downloads required!

โฌ‡๏ธ Download Web Hooks

๐Ÿ›œ Ping Web Hook

Enables ping-ip:// links to automatically open a command window and ping the target IP address.

What it does: Runs 4 pings and pauses so you can see the results.

Example link: <a href="ping-ip://8.8.8.8">Ping Google DNS</a>

๐Ÿ›ก๏ธ SSH Web Hook (PuTTY)

Enables ssh-ip:// links to automatically launch PuTTY with an SSH connection to the target IP.

Requirement: PuTTY must be installed at C:\Program Files\PuTTY\putty.exe

Example link:<a href="ssh-ip://192.168.1.1">SSH to Router</a>

๐Ÿ” SFTP Web Hook (FileZilla)

Enables sftp-ip:// links to automatically launch FileZilla with an SFTP connection to the target IP.

Requirement: FileZilla must be installed at C:\Program Files\FileZilla FTP Client\filezilla.exe

Example link:<a href="sftp-ip://192.168.1.1">SFTP to Server</a>

Step 2: Install the Web Hooks

For each .reg file you downloaded:

  • โ†’ Double-click the .reg file
  • โ†’ Click "Yes" when Windows asks if you want to add it to the registry
  • โ†’ Click "OK" on the confirmation message(s)
  • โš ๏ธ If you get a security error, use Step 4 below to do the install

Step 3: Test the Web Hooks

Test your new Web Hooks using the applet below.

Step 4 (Optional): Import and Verify the Installation using RegEdit

To manually import the files and verify the installation:

  • โ†’ Press Win + R to open Run dialog
  • โ†’ Type regedit and press Enter
  • โ†’ Select File โ†’ Import to import your new web hook files
  • โ†’ Navigate to HKEY_CLASSES_ROOT
  • โ†’ Search for ping-ip, ssh-ip, and sftp-ip entries