Usamos cookies para mejorar tu experiencia en el sitio
CodeWorlds
Volver a colecciones
Guide17 min read

Goose - Autonomiczny Agent AI do Programowania

Goose by Block is an open-source autonomous AI coding agent. Builds projects from scratch, debugs, executes code and manages workflows - all autonomously.

Goose - Autonomiczny Agent AI do Programowania

Czym jest Goose?

Goose to open-source'owy autonomiczny agent AI stworzony przez Block (dawniej Square). W przeciwieństwie do prostych asystentów kodu oferujących sugestie, Goose może wykonywać całe projekty od początku do końca - planuje, pisze kod, debuguje, testuje i zarządza workflow bez ciągłego nadzoru człowieka.

Wyobraź sobie, że mówisz:

"Stwórz API REST w Node.js z autoryzacją JWT, bazą PostgreSQL i pełnymi testami"

Goose:

  1. Analizuje wymagania
  2. Projektuje architekturę
  3. Tworzy strukturę projektu
  4. Implementuje endpointy
  5. Konfiguruje bazę danych
  6. Pisze testy
  7. Debuguje problemy
  8. Wszystko autonomicznie

To właśnie oferuje Goose - prawdziwie autonomiczny development.

Kluczowe cechy

  • Autonomia - Sam decyduje o kolejnych krokach
  • Multi-LLM - Obsługuje różne modele (Claude, GPT, lokalne)
  • MCP Integration - Integracja z MCP servers
  • Desktop + CLI - Aplikacja desktopowa i terminal
  • Open-source - Licencja Apache 2.0
  • Rust core - Wydajny i bezpieczny

GitHub

Repository: github.com/block/goose

Dokumentacja: block.github.io/goose

Status: 29k+ GitHub stars | 360+ contributors | Apache 2.0

Dlaczego Goose?

Problem z typowymi asystentami AI

Większość narzędzi AI do kodowania:

  1. Reaktywne - Czekają na polecenia, nie podejmują inicjatywy
  2. Fragmentaryczne - Pomagają z fragmentami kodu, nie całymi projektami
  3. Wymagają nadzoru - Każdy krok wymaga zatwierdzenia
  4. Brak kontekstu - Nie pamiętają poprzednich decyzji
  5. Izolowane - Nie integrują się z narzędziami deweloperskimi

Rozwiązanie Goose

Code
TEXT
┌─────────────────────────────────────────────────────────────┐
│                    GOOSE WORKFLOW                            │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│   ┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐  │
│   │ ANALYZE │ -> │  PLAN   │ -> │  CODE   │ -> │  TEST   │  │
│   └─────────┘    └─────────┘    └─────────┘    └─────────┘  │
│        │                                             │       │
│        │              ┌─────────┐                    │       │
│        └──────────────│  DEBUG  │<───────────────────┘       │
│                       └─────────┘                            │
│                            │                                 │
│                       ┌─────────┐                            │
│                       │ DEPLOY  │                            │
│                       └─────────┘                            │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Kluczowe zalety

  1. Pełna autonomia - Goose sam planuje i wykonuje
  2. Multi-LLM - Optymalizuj koszty i wydajność między modelami
  3. MCP servers - Rozszerzaj możliwości przez integracje
  4. Open-source - Pełna kontrola nad kodem
  5. Desktop + CLI - Wybierz preferowany interfejs
  6. Rust core - Szybki i bezpieczny

Instalacja

Desktop App (macOS/Windows/Linux)

Code
Bash
# macOS (Homebrew)
brew install --cask goose

# Lub pobierz z releases
# https://github.com/block/goose/releases

CLI

Code
Bash
# macOS/Linux
curl -fsSL https://github.com/block/goose/releases/latest/download/install.sh | sh

# Weryfikacja
goose --version

Konfiguracja modelu

Code
Bash
# Ustaw klucz API
export ANTHROPIC_API_KEY=your_key
# lub
export OPENAI_API_KEY=your_key

# Lub konfiguracja przez CLI
goose config set model claude-sonnet-4-5-20250514

Plik konfiguracyjny

~/.goose/config.yaml
YAML
# ~/.goose/config.yaml
model:
  primary: claude-sonnet-4-5-20250514
  fallback: gpt-4o
  local: ollama/codellama

settings:
  auto_approve: false
  max_iterations: 50
  timeout: 300

mcp_servers:
  - github
  - filesystem
  - browser

Podstawowe użycie

Uruchomienie interaktywne

Code
Bash
# Start Goose w bieżącym katalogu
goose

# Goose przeanalizuje projekt i zapyta o zadanie
🪿 Goose: I've analyzed your project. It's a Next.js app with TypeScript.
         What would you like me to do?

> Add a dark mode toggle to the navbar

Jednorazowe zadanie

Code
Bash
# Wykonaj zadanie bez trybu interaktywnego
goose run "Create a REST API with Express and MongoDB"

# Z plikiem instrukcji
goose run --file tasks.md

Przykładowe zadania

Code
Bash
# Stworzenie projektu od zera
goose run "Create a React + Vite + TypeScript todo app with Zustand state management"

# Refaktoring
goose run "Refactor the auth module to use JWT instead of sessions"

# Debugging
goose run "The tests in src/api are failing. Find and fix the issues"

# Migracja
goose run "Migrate this project from JavaScript to TypeScript"

# Code review
goose run "Review the PR changes and suggest improvements"

Autonomiczny workflow

Faza 1: Analiza

Code
TEXT
🪿 Goose: Analyzing your request...

Task: Create a REST API with Express and MongoDB
Requirements identified:
- Express.js server setup
- MongoDB connection and models
- CRUD endpoints
- Error handling
- Environment configuration
- Basic authentication

Faza 2: Planowanie

Code
TEXT
🪿 Goose: Here's my implementation plan:

1. Initialize Node.js project with TypeScript
2. Set up Express server with middleware
3. Configure MongoDB with Mongoose
4. Create User model with validation
5. Implement auth endpoints (register, login)
6. Add CRUD endpoints for resources
7. Write tests with Jest
8. Add Docker configuration

Proceed? [Y/n]

Faza 3: Implementacja

Code
TEXT
🪿 Goose: Starting implementation...

[1/8] Initializing project...
      ✓ Created package.json
      ✓ Installed dependencies
      ✓ Set up TypeScript config

[2/8] Setting up Express...
      ✓ Created src/index.ts
      ✓ Added middleware (cors, helmet, morgan)
      ✓ Configured error handling

[3/8] Configuring MongoDB...
      ✓ Created database connection
      ✓ Added connection retry logic
      ✓ Created .env.example

... continuing autonomously ...

Faza 4: Testowanie

Code
TEXT
🪿 Goose: Running tests...

PASS  src/__tests__/auth.test.ts
  ✓ should register a new user (45 ms)
  ✓ should login with valid credentials (23 ms)
  ✓ should reject invalid credentials (12 ms)

PASS  src/__tests__/users.test.ts
  ✓ should create a user (34 ms)
  ✓ should get all users (21 ms)
  ...

Test Suites: 4 passed, 4 total
Tests:       18 passed, 18 total

Faza 5: Debugging (jeśli potrzebne)

Code
TEXT
🪿 Goose: Found an issue in user validation...

Error: ValidationError: User validation failed
Location: src/models/User.ts:23

Fixing...
✓ Updated email regex pattern
✓ Added proper error messages
✓ Retesting...

All tests passing now.

Multi-LLM Configuration

Goose pozwala optymalizować użycie różnych modeli:

~/.goose/config.yaml
YAML
# ~/.goose/config.yaml
models:
  # Główny model dla złożonych zadań
  complex:
    provider: anthropic
    model: claude-opus-4-5-20250514
    max_tokens: 8192

  # Szybki model dla prostych operacji
  simple:
    provider: anthropic
    model: claude-haiku-3-5-20241022
    max_tokens: 4096

  # Lokalny model dla wrażliwych danych
  local:
    provider: ollama
    model: codellama:34b
    endpoint: http://localhost:11434

routing:
  # Użyj różnych modeli dla różnych zadań
  planning: complex
  code_generation: complex
  refactoring: complex
  documentation: simple
  formatting: local
  sensitive_data: local

MCP Integration

Goose integruje się z MCP (Model Context Protocol) servers:

Wbudowane serwery

~/.goose/mcp.yaml
YAML
# ~/.goose/mcp.yaml
servers:
  filesystem:
    enabled: true
    allowed_paths:
      - ~/Projects
      - /tmp

  browser:
    enabled: true
    headless: true

  github:
    enabled: true
    token: ${GITHUB_TOKEN}

  shell:
    enabled: true
    allowed_commands:
      - npm
      - pnpm
      - git
      - docker

Custom MCP Server

Code
Bash
# Dodaj custom MCP server
goose mcp add my-server --endpoint http://localhost:3000

# Lista aktywnych serwerów
goose mcp list

Przypadki użycia

Prototypowanie

Code
Bash
goose run "Create a full-stack prototype for a booking system with:
- Next.js frontend
- Supabase backend
- Calendar component
- Payment integration mockup"

# Goose w ~30 minut stworzy działający prototyp

Legacy code migration

Code
Bash
goose run "Migrate this Express.js API to NestJS:
- Keep the same endpoints
- Use TypeORM instead of Mongoose
- Add Swagger documentation"

Bug fixing

Code
Bash
goose run "Users report that file upload fails for images > 5MB.
Find the issue and fix it, then add appropriate tests."

Code review assistant

Code
Bash
goose run "Review PR #42 and:
- Check for security issues
- Identify performance problems
- Suggest improvements
- Create a summary"

Documentation generation

Code
Bash
goose run "Generate comprehensive documentation for this project:
- API documentation with examples
- Architecture overview
- Setup guide
- Contributing guidelines"

Goose vs alternatywy

FunkcjaGooseClaude CodeDevinCursor
AutonomiaPełnaCzęściowaPełnaMinimalna
Open-source✅ Apache 2.0Częściowo
Desktop app
CLI
Multi-LLM❌ (tylko Claude)
MCP support
KosztAPI costsAPI costs$500/mo$20/mo
Lokalne modele

Bezpieczeństwo

Approval mode

Code
YAML
# Wymagaj zatwierdzenia dla wrażliwych operacji
security:
  require_approval:
    - file_delete
    - git_push
    - npm_publish
    - docker_build
    - database_migration

Sandboxing

Code
YAML
# Uruchom Goose w sandboxie
sandbox:
  enabled: true
  network: restricted
  filesystem:
    readonly:
      - /etc
      - /usr
    writable:
      - ~/Projects/current

Audit log

Code
Bash
# Zobacz historię akcji
goose audit --last 24h

# Eksport do analizy
goose audit export --format json > audit.json

Rozwiązywanie problemów

Goose utknął w pętli

Code
Bash
# Ogranicz iteracje
goose run --max-iterations 10 "Task..."

# Lub w konfiguracji
settings:
  max_iterations: 20
  iteration_timeout: 60

Za duże koszty API

Code
Bash
# Użyj tańszych modeli dla prostych zadań
goose config set routing.simple haiku

# Włącz cache
goose config set cache.enabled true

Problemy z MCP

Code
Bash
# Zdiagnozuj MCP
goose mcp diagnose

# Restart serwerów
goose mcp restart

FAQ - Najczęściej zadawane pytania

Czy Goose jest darmowy?

Tak, Goose jest open-source (Apache 2.0). Płacisz tylko za API wybranego modelu AI.

Jakie modele są wspierane?

  • Anthropic Claude (wszystkie wersje)
  • OpenAI GPT-4, GPT-4o
  • Lokalne modele przez Ollama
  • Google Gemini (w development)

Czy mogę używać Goose bez internetu?

Tak, z lokalnymi modelami przez Ollama. Jednak możliwości będą ograniczone w porównaniu do Claude/GPT.

Jak bezpieczny jest Goose?

Goose oferuje:

  • Approval mode dla wrażliwych operacji
  • Sandboxing
  • Ograniczenia dostępu do plików
  • Audit logs

Czy Goose zastąpi developerów?

Nie. Goose to narzędzie zwiększające produktywność. Nadal potrzebujesz wiedzy, żeby:

  • Definiować wymagania
  • Weryfikować rozwiązania
  • Podejmować decyzje architektoniczne
  • Obsługiwać edge cases

Podsumowanie

Goose reprezentuje przyszłość autonomicznego programowania:

  • Pełna autonomia - Planuje i wykonuje całe projekty
  • Multi-LLM - Optymalizuj koszty i wydajność
  • MCP Integration - Rozszerzaj możliwości
  • Open-source - Apache 2.0, pełna kontrola
  • Desktop + CLI - Wybierz swój interfejs
  • Rust core - Wydajny i bezpieczny

Goose zmienia paradygmat z "AI-assisted coding" na "AI-autonomous coding" - gdzie deweloper staje się architektem i nadzorcą, a nie wykonawcą każdej linii kodu.


Goose - Autonomous AI Coding Agent

What is Goose?

Goose is an open-source autonomous AI agent created by Block (formerly Square). Unlike simple code assistants that offer suggestions, Goose can execute entire projects from start to finish - it plans, writes code, debugs, tests, and manages workflows without constant human supervision.

Imagine saying:

"Create a REST API in Node.js with JWT authorization, PostgreSQL database, and full tests"

Goose:

  1. Analyzes requirements
  2. Designs architecture
  3. Creates project structure
  4. Implements endpoints
  5. Configures database
  6. Writes tests
  7. Debugs issues
  8. All autonomously

That's exactly what Goose offers - truly autonomous development.

Key features

  • Autonomy - Decides on next steps independently
  • Multi-LLM - Supports various models (Claude, GPT, local)
  • MCP Integration - Integration with MCP servers
  • Desktop + CLI - Desktop application and terminal
  • Open-source - Apache 2.0 license
  • Rust core - Efficient and secure

GitHub

Repository: github.com/block/goose

Documentation: block.github.io/goose

Status: 29k+ GitHub stars | 360+ contributors | Apache 2.0

Why Goose?

The problem with typical AI assistants

Most AI coding tools are:

  1. Reactive - Wait for commands, don't take initiative
  2. Fragmentary - Help with code snippets, not entire projects
  3. Require supervision - Every step needs approval
  4. Lack context - Don't remember previous decisions
  5. Isolated - Don't integrate with developer tools

The Goose solution

Code
TEXT
┌─────────────────────────────────────────────────────────────┐
│                    GOOSE WORKFLOW                            │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│   ┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐  │
│   │ ANALYZE │ -> │  PLAN   │ -> │  CODE   │ -> │  TEST   │  │
│   └─────────┘    └─────────┘    └─────────┘    └─────────┘  │
│        │                                             │       │
│        │              ┌─────────┐                    │       │
│        └──────────────│  DEBUG  │<───────────────────┘       │
│                       └─────────┘                            │
│                            │                                 │
│                       ┌─────────┐                            │
│                       │ DEPLOY  │                            │
│                       └─────────┘                            │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Key advantages

  1. Full autonomy - Goose plans and executes on its own
  2. Multi-LLM - Optimize costs and performance between models
  3. MCP servers - Extend capabilities through integrations
  4. Open-source - Full control over the code
  5. Desktop + CLI - Choose your preferred interface
  6. Rust core - Fast and secure

Installation

Desktop App (macOS/Windows/Linux)

Code
Bash
# macOS (Homebrew)
brew install --cask goose

# Or download from releases
# https://github.com/block/goose/releases

CLI

Code
Bash
# macOS/Linux
curl -fsSL https://github.com/block/goose/releases/latest/download/install.sh | sh

# Verification
goose --version

Model configuration

Code
Bash
# Set API key
export ANTHROPIC_API_KEY=your_key
# or
export OPENAI_API_KEY=your_key

# Or configure via CLI
goose config set model claude-sonnet-4-5-20250514

Configuration file

~/.goose/config.yaml
YAML
# ~/.goose/config.yaml
model:
  primary: claude-sonnet-4-5-20250514
  fallback: gpt-4o
  local: ollama/codellama

settings:
  auto_approve: false
  max_iterations: 50
  timeout: 300

mcp_servers:
  - github
  - filesystem
  - browser

Basic usage

Interactive mode

Code
Bash
# Start Goose in current directory
goose

# Goose will analyze the project and ask about the task
🪿 Goose: I've analyzed your project. It's a Next.js app with TypeScript.
         What would you like me to do?

> Add a dark mode toggle to the navbar

One-time task

Code
Bash
# Execute task without interactive mode
goose run "Create a REST API with Express and MongoDB"

# With instruction file
goose run --file tasks.md

Example tasks

Code
Bash
# Create project from scratch
goose run "Create a React + Vite + TypeScript todo app with Zustand state management"

# Refactoring
goose run "Refactor the auth module to use JWT instead of sessions"

# Debugging
goose run "The tests in src/api are failing. Find and fix the issues"

# Migration
goose run "Migrate this project from JavaScript to TypeScript"

# Code review
goose run "Review the PR changes and suggest improvements"

Autonomous workflow

Phase 1: Analysis

Code
TEXT
🪿 Goose: Analyzing your request...

Task: Create a REST API with Express and MongoDB
Requirements identified:
- Express.js server setup
- MongoDB connection and models
- CRUD endpoints
- Error handling
- Environment configuration
- Basic authentication

Phase 2: Planning

Code
TEXT
🪿 Goose: Here's my implementation plan:

1. Initialize Node.js project with TypeScript
2. Set up Express server with middleware
3. Configure MongoDB with Mongoose
4. Create User model with validation
5. Implement auth endpoints (register, login)
6. Add CRUD endpoints for resources
7. Write tests with Jest
8. Add Docker configuration

Proceed? [Y/n]

Phase 3: Implementation

Code
TEXT
🪿 Goose: Starting implementation...

[1/8] Initializing project...
      ✓ Created package.json
      ✓ Installed dependencies
      ✓ Set up TypeScript config

[2/8] Setting up Express...
      ✓ Created src/index.ts
      ✓ Added middleware (cors, helmet, morgan)
      ✓ Configured error handling

[3/8] Configuring MongoDB...
      ✓ Created database connection
      ✓ Added connection retry logic
      ✓ Created .env.example

... continuing autonomously ...

Phase 4: Testing

Code
TEXT
🪿 Goose: Running tests...

PASS  src/__tests__/auth.test.ts
  ✓ should register a new user (45 ms)
  ✓ should login with valid credentials (23 ms)
  ✓ should reject invalid credentials (12 ms)

PASS  src/__tests__/users.test.ts
  ✓ should create a user (34 ms)
  ✓ should get all users (21 ms)
  ...

Test Suites: 4 passed, 4 total
Tests:       18 passed, 18 total

Phase 5: Debugging (if needed)

Code
TEXT
🪿 Goose: Found an issue in user validation...

Error: ValidationError: User validation failed
Location: src/models/User.ts:23

Fixing...
✓ Updated email regex pattern
✓ Added proper error messages
✓ Retesting...

All tests passing now.

Multi-LLM configuration

Goose allows you to optimize usage of different models:

~/.goose/config.yaml
YAML
# ~/.goose/config.yaml
models:
  # Primary model for complex tasks
  complex:
    provider: anthropic
    model: claude-opus-4-5-20250514
    max_tokens: 8192

  # Fast model for simple operations
  simple:
    provider: anthropic
    model: claude-haiku-3-5-20241022
    max_tokens: 4096

  # Local model for sensitive data
  local:
    provider: ollama
    model: codellama:34b
    endpoint: http://localhost:11434

routing:
  # Use different models for different tasks
  planning: complex
  code_generation: complex
  refactoring: complex
  documentation: simple
  formatting: local
  sensitive_data: local

MCP Integration

Goose integrates with MCP (Model Context Protocol) servers:

Built-in servers

~/.goose/mcp.yaml
YAML
# ~/.goose/mcp.yaml
servers:
  filesystem:
    enabled: true
    allowed_paths:
      - ~/Projects
      - /tmp

  browser:
    enabled: true
    headless: true

  github:
    enabled: true
    token: ${GITHUB_TOKEN}

  shell:
    enabled: true
    allowed_commands:
      - npm
      - pnpm
      - git
      - docker

Custom MCP Server

Code
Bash
# Add custom MCP server
goose mcp add my-server --endpoint http://localhost:3000

# List active servers
goose mcp list

Use cases

Prototyping

Code
Bash
goose run "Create a full-stack prototype for a booking system with:
- Next.js frontend
- Supabase backend
- Calendar component
- Payment integration mockup"

# Goose will create a working prototype in ~30 minutes

Legacy code migration

Code
Bash
goose run "Migrate this Express.js API to NestJS:
- Keep the same endpoints
- Use TypeORM instead of Mongoose
- Add Swagger documentation"

Bug fixing

Code
Bash
goose run "Users report that file upload fails for images > 5MB.
Find the issue and fix it, then add appropriate tests."

Code review assistant

Code
Bash
goose run "Review PR #42 and:
- Check for security issues
- Identify performance problems
- Suggest improvements
- Create a summary"

Documentation generation

Code
Bash
goose run "Generate comprehensive documentation for this project:
- API documentation with examples
- Architecture overview
- Setup guide
- Contributing guidelines"

Goose vs alternatives

FeatureGooseClaude CodeDevinCursor
AutonomyFullPartialFullMinimal
Open-source✅ Apache 2.0Partial
Desktop app
CLI
Multi-LLM❌ (Claude only)
MCP support
CostAPI costsAPI costs$500/mo$20/mo
Local models

Security

Approval mode

Code
YAML
# Require approval for sensitive operations
security:
  require_approval:
    - file_delete
    - git_push
    - npm_publish
    - docker_build
    - database_migration

Sandboxing

Code
YAML
# Run Goose in a sandbox
sandbox:
  enabled: true
  network: restricted
  filesystem:
    readonly:
      - /etc
      - /usr
    writable:
      - ~/Projects/current

Audit log

Code
Bash
# View action history
goose audit --last 24h

# Export for analysis
goose audit export --format json > audit.json

Troubleshooting

Goose stuck in a loop

Code
Bash
# Limit iterations
goose run --max-iterations 10 "Task..."

# Or in configuration
settings:
  max_iterations: 20
  iteration_timeout: 60

API costs too high

Code
Bash
# Use cheaper models for simple tasks
goose config set routing.simple haiku

# Enable cache
goose config set cache.enabled true

MCP problems

Code
Bash
# Diagnose MCP
goose mcp diagnose

# Restart servers
goose mcp restart

FAQ - Frequently asked questions

Is Goose free?

Yes, Goose is open-source (Apache 2.0). You only pay for the API of your chosen AI model.

What models are supported?

  • Anthropic Claude (all versions)
  • OpenAI GPT-4, GPT-4o
  • Local models via Ollama
  • Google Gemini (in development)

Can I use Goose offline?

Yes, with local models via Ollama. However, capabilities will be limited compared to Claude/GPT.

How secure is Goose?

Goose offers:

  • Approval mode for sensitive operations
  • Sandboxing
  • File access restrictions
  • Audit logs

Will Goose replace developers?

No. Goose is a productivity tool. You still need knowledge to:

  • Define requirements
  • Verify solutions
  • Make architectural decisions
  • Handle edge cases

Summary

Goose represents the future of autonomous programming:

  • Full autonomy - Plans and executes entire projects
  • Multi-LLM - Optimize costs and performance
  • MCP Integration - Extend capabilities
  • Open-source - Apache 2.0, full control
  • Desktop + CLI - Choose your interface
  • Rust core - Efficient and secure

Goose changes the paradigm from "AI-assisted coding" to "AI-autonomous coding" - where developers become architects and supervisors, not executors of every line of code.