Loading...
Loading...
Terminal-based spreadsheet TUI tool written in Go for editing CSV files in the terminal with vim-like keybindings
npx skill4agent add aradotso/trending-skills sheets-terminal-spreadsheetSkill by ara.so — Daily 2026 Skills collection.
go install github.com/maaslalani/sheets@mainsheets --helpsheets budget.csvsheets <<< "ID,Name,Age
1,Alice,24
2,Bob,32
3,Charlie,26"cat data.csv | sheetssheets budget.csv B9
# Output: 2760sheets budget.csv B1:B3
# Output:
# 1200
# 950
# 810# Set one cell
sheets budget.csv B7=10
# Set multiple cells
sheets budget.csv B7=10 B8=20| Key | Action |
|---|---|
| Move left, down, up, right |
| Jump to top |
| Jump to bottom |
| Jump to row 5 |
| Jump to cell B9 |
| Jump to first column |
| Jump to first non-empty column in row |
| Jump to last non-empty column in row |
| Jump to top / middle / bottom visible row |
| Move half page up / down |
| Key | Action |
|---|---|
| Align current row to top of window |
| Align current row to middle of window |
| Align current row to bottom of window |
| Key | Action |
|---|---|
| Search forward |
| Search backward |
| Repeat last search (forward) |
| Repeat last search (backward) |
| Key | Action |
|---|---|
| Set mark |
| Jump to mark |
| Move backward through jump list |
| Move forward through jump list |
| Key | Action |
|---|---|
| Edit current cell |
| Edit from start of cell |
| Clear cell and start editing |
| Leave insert / visual / command mode |
| Commit and move down |
| Commit and move right |
| Commit and move left |
| Commit and move down |
| Commit and move up |
| Key | Action |
|---|---|
| Insert row below and start editing |
| Insert row above and start editing |
| Delete current row |
| Key | Action |
|---|---|
| Yank (copy) current cell |
| Yank current row(s) |
| Cut current cell or selection |
| Paste current register |
| Key | Action |
|---|---|
| Undo |
| Redo |
| Undo all changes |
| Repeat last change |
vV| Key | Action |
|---|---|
| Start visual cell selection |
| Start visual row selection |
| Insert formula after selected range (e.g., |
:| Command | Action |
|---|---|
| Save file |
| Save to a new file |
| Open another CSV file |
| Quit |
| Save and quit |
| Jump to cell B9 |
| Jump to cell B9 (shorthand) |
# Create a CSV with headers
echo "Name,Amount,Category" > budget.csv
sheets budget.csv# Generate CSV from a database query and edit in sheets
psql -c "COPY (SELECT * FROM sales) TO STDOUT WITH CSV HEADER" | sheets#!/bin/bash
# Update Q4 value in financial report
sheets report.csv D4=95000 D5=102000 D6=88000
echo "Updated Q4 values in report.csv"#!/bin/bash
# Extract column B rows 1-10 and sum them in bash
values=$(sheets data.csv B1:B10)
total=0
while IFS= read -r line; do
total=$((total + line))
done <<< "$values"
echo "Total: $total"#!/bin/bash
# Get current budget total from spreadsheet
budget_total=$(sheets budget.csv C15)
if [ "$budget_total" -gt 10000 ]; then
echo "Budget exceeded!"
fipackage main
import (
"encoding/csv"
"fmt"
"os"
"os/exec"
)
func createAndOpenSpreadsheet(data [][]string, filename string) error {
// Write CSV data
f, err := os.Create(filename)
if err != nil {
return fmt.Errorf("creating file: %w", err)
}
defer f.Close()
w := csv.NewWriter(f)
if err := w.WriteAll(data); err != nil {
return fmt.Errorf("writing CSV: %w", err)
}
w.Flush()
// Open in sheets TUI
cmd := exec.Command("sheets", filename)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
func main() {
data := [][]string{
{"Month", "Revenue", "Expenses", "Profit"},
{"January", "12000", "8500", "3500"},
{"February", "13500", "9200", "4300"},
{"March", "11800", "8900", "2900"},
}
if err := createAndOpenSpreadsheet(data, "monthly_report.csv"); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}package main
import (
"fmt"
"os/exec"
"strings"
)
func readCell(csvFile, cell string) (string, error) {
out, err := exec.Command("sheets", csvFile, cell).Output()
if err != nil {
return "", fmt.Errorf("reading cell %s: %w", cell, err)
}
return strings.TrimSpace(string(out)), nil
}
func readRange(csvFile, cellRange string) ([]string, error) {
out, err := exec.Command("sheets", csvFile, cellRange).Output()
if err != nil {
return nil, fmt.Errorf("reading range %s: %w", cellRange, err)
}
lines := strings.Split(strings.TrimSpace(string(out)), "\n")
return lines, nil
}
func main() {
total, err := readCell("budget.csv", "B9")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Budget total:", total)
values, err := readRange("budget.csv", "B1:B6")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Monthly values:", values)
}# Instead of cat data.csv
sheets data.csv
# Instead of awk/sed edits for simple changes
sheets data.csv B3=new_valuev==|(B1:B8)ggGhjklicdductrl+r/sheets# Ensure Go bin directory is in PATH
export PATH=$PATH:$(go env GOPATH)/bin
# Or install again and verify
go install github.com/maaslalani/sheets@main
which sheets:w:wqqctrl+cTERMecho $TERM# Excel to CSV (using Python)
python3 -c "import pandas as pd; pd.read_excel('data.xlsx').to_csv('data.csv', index=False)"
sheets data.csv:goto A10005G