# What Programming Language Is Fabric Written In? Inside Fabric's Go and TypeScript Stack

> Discover Fabric's core programming language. Learn about its Go backend and TypeScript frontend for a powerful web interface.

- Repository: [Daniel Miessler 🛡️/fabric](https://github.com/danielmiessler/fabric)
- Tags: deep-dive
- Published: 2026-02-28

---

**Fabric is primarily written in Go (Golang), with a TypeScript and Svelte frontend for its optional web interface.**

Fabric is an open-source framework for augmenting humans using AI, hosted in the `danielmiessler/fabric` repository. Understanding what programming language Fabric is written in is essential for developers looking to contribute, extend, or integrate with the toolchain. While the project leverages modern web technologies for its UI, the core execution engine and command-line interface are implemented entirely in Go.

## The Core Language: Go (Golang)

Fabric's engine, command-line interface, and server logic are implemented entirely in **Go**. The repository's `go.mod` file establishes the module path and dependencies, confirming this is a Go-based project that uses standard Go toolchain conventions for building and dependency resolution.

### Module Declaration and Dependencies

The root `go.mod` file declares the module as `github.com/danielmiessler/fabric` and manages dependencies using Go's standard module system. This file serves as the definitive indicator that Fabric is written in Go, initializing the Go toolchain for building and dependency resolution across the project.

### CLI and Internal Packages

The main entry point resides in [`cmd/fabric/main.go`](https://github.com/danielmiessler/fabric/blob/main/cmd/fabric/main.go), which contains the `func main()` declaration that initializes the command-line interface. Core functionality lives in the `internal/` directory, where Go packages handle pattern processing, AI provider integrations, and session management. For example, [`internal/plugins/template/template.go`](https://github.com/danielmiessler/fabric/blob/main/internal/plugins/template/template.go) contains the logic for processing pattern templates and extensions, while [`internal/server/serve.go`](https://github.com/danielmiessler/fabric/blob/main/internal/server/serve.go) implements the HTTP server for the web interface.

## The Web Interface: TypeScript and Svelte

While the backend is Go, Fabric includes an optional web UI located in the `web/` directory. This frontend is built with **Svelte** and written in **TypeScript** (compiled to JavaScript).

### Frontend Architecture

The file `web/src/routes/+page.svelte` serves as the entry point for the web interface. This is a thin client layer that communicates with the Go backend via HTTP requests. The TypeScript code handles UI state and user interactions, but all heavy processing—pattern execution, API calls to AI providers, and data persistence—occurs in the Go server.

## Key Source Files and Architecture

Understanding the repository structure clarifies how the languages divide responsibilities:

- `go.mod` — Go module definition and dependency management
- [`cmd/fabric/main.go`](https://github.com/danielmiessler/fabric/blob/main/cmd/fabric/main.go) — CLI entry point and command setup
- [`internal/server/serve.go`](https://github.com/danielmiessler/fabric/blob/main/internal/server/serve.go) — HTTP server implementation for the web UI
- [`internal/plugins/template/template.go`](https://github.com/danielmiessler/fabric/blob/main/internal/plugins/template/template.go) — Pattern processing engine
- `web/src/routes/+page.svelte` — Web UI entry component

## Working with Fabric's Codebase

### Installing from Source

Since Fabric is written in Go, you can compile it directly using the Go toolchain:

```bash

# Install the latest version (compiles the Go binary)

go install github.com/danielmiessler/fabric@latest

# Verify the installation

fabric --version

```

### Programmatic Integration

You can import Fabric's Go packages into your own applications:

```go
package main

import (
    "context"
    "log"

    "github.com/danielmiessler/fabric/internal/cli"
)

func main() {
    // Create a Fabric CLI instance with default config
    fcli := cli.New()

    // Run a simple pattern against a prompt
    err := fcli.Run(context.Background(), []string{"--pattern", "summarize"}, "https://example.com/article")
    if err != nil {
        log.Fatalf("fabric failed: %v", err)
    }
}

```

### Running the Web Server

To launch the optional web interface:

```bash

# Start the HTTP server (Go backend serving the Svelte frontend)

fabric --serve

```

Then navigate to `http://localhost:8080` to access the UI.

## Summary

- Fabric is primarily written in **Go (Golang)**, with the core engine, CLI, and server logic implemented in Go packages under `cmd/` and `internal/`.
- The optional web interface uses **TypeScript** and **Svelte**, but this is a thin frontend layer that communicates with the Go backend.
- Key files include `go.mod` (module definition), [`cmd/fabric/main.go`](https://github.com/danielmiessler/fabric/blob/main/cmd/fabric/main.go) (entry point), and [`internal/server/serve.go`](https://github.com/danielmiessler/fabric/blob/main/internal/server/serve.go) (HTTP server).
- You can install Fabric using `go install`, import its packages programmatically, or run the web server with `fabric --serve`.

## Frequently Asked Questions

### Is Fabric written in Python?

No. Despite being an AI tooling framework, Fabric is not written in Python. It is implemented primarily in **Go (Golang)**. The repository contains no Python source files for the core engine; all pattern processing, AI provider integrations, and CLI functionality are handled by Go packages in the `internal/` directory.

### What frontend framework does Fabric use?

Fabric uses **Svelte** with **TypeScript** for its optional web interface. The frontend code resides in the `web/` directory, with `web/src/routes/+page.svelte` serving as the main entry point. This frontend communicates with the Go backend via HTTP API calls.

### Can I contribute to Fabric if I only know Go?

Yes. Since Fabric is written primarily in Go, contributors with Go experience can work on the core engine, CLI improvements, pattern processing logic, and server functionality. The `internal/` and `cmd/` directories contain the main Go source files where contributions are most valuable, while the `web/` directory requires TypeScript/Svelte knowledge only for UI-specific changes.

### How do I compile Fabric from source?

To compile Fabric from source, you need the **Go toolchain** (version 1.21 or later recommended). Clone the repository and run `go build` in the root directory, or use `go install github.com/danielmiessler/fabric@latest` to directly compile and install the binary to your `$GOPATH/bin`.