Skip to content
OpenSmartRoute
Skillv1.0.0

x-last

Enhanced `last` command with CSV, JSON, tree view, and interactive UI for viewing login history. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options)

by x-cmd(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from x-cmd/x-cmd (mod/last/SKILL.md). Install upstream with npx skills add x-cmd/x-cmd --skill last. Copyright stays with the author (Apache-2.0).

x last - User Login History

Enhanced last command with multiple output formats, tree view, and interactive UI.


Quick Start

# Interactive login history viewer (default in TTY)
x last

# All records
x last --all

Features

  • Multiple formats: CSV, JSON, tree view
  • Interactive UI: Built-in picker for TTY mode
  • Filtering options: Login only, reboot only, all records
  • Session duration: Calculated login session lengths
  • Tree view: Grouped by system reboot

Commands

Command Description
x last Interactive view (default) / CSV (piped)
x last --all All records (TTY: interactive picker)
x last --login Login records only, exclude reboots
x last --reboot System reboot records only
x last --tree Tree view grouped by reboot
x last --csv CSV format output
x last --json JSON format output

Examples

Basic Usage

# Default view
x last

# All records with interactive picker
x last --all

# Login records only
x last --login

Format Output

# JSON format
x last --json

# CSV format
x last --csv

# Tree view
x last --tree

Filtering

# Specific user
x last username

# Specific TTY
x last tty7

# Reboot records only
x last --reboot

Data Processing

# Parse with jq
x last --json | jq '.[] | select(.user == "root")'

# Find recent reboots
x last --reboot --json | jq '.[0:5]'

Output Fields

Field Description Example
user Username john, reboot
tty Terminal pts/0, tty7
host Remote host 192.168.1.100
login Login time Mon Jan 15 09:30
logout Logout time Mon Jan 15 17:45
duration Session duration 08:15

Platform Notes

Linux

  • Uses native last command
  • Reads from /var/log/wtmp

macOS

  • Uses native last command
  • Full feature support

Windows

  • Limited support (no native last command)

Related

  • Native last(1) manual page

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/x-cmd-x-cmd-last/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

x-cmd-x-cmd-last.ocm.jsonjson
{
  "ocm": "1",
  "id": "x-cmd-x-cmd-last",
  "kind": "skill",
  "name": "x-last",
  "description": "Enhanced `last` command with CSV, JSON, tree view, and interactive UI for viewing login history. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.",
  "publisher": "x-cmd",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "data_analysis"
    ],
    "tags": [
      "skill-md",
      "x-cmd",
      "system",
      "last",
      "login",
      "security",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Enhanced `last` command with CSV, JSON, tree view, and interactive UI for viewing login history. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/x-cmd/x-cmd",
      "path": "mod/last/SKILL.md",
      "ref": "e18c1ef8b4695c7556c4e847b2eb7eaac13b9230",
      "url": "https://github.com/x-cmd/x-cmd/blob/e18c1ef8b4695c7556c4e847b2eb7eaac13b9230/mod/last/SKILL.md",
      "key": "x-cmd/x-cmd/mod/last/SKILL.md"
    },
    "compatibility": "POSIX Shell",
    "license": "Apache-2.0"
  },
  "instructions": "# x last - User Login History\n\n> Enhanced `last` command with multiple output formats, tree view, and interactive UI.\n\n---\n\n## Quick Start\n\n```bash\n# Interactive login history viewer (default in TTY)\nx last\n\n# All records\nx last --all\n```\n\n---\n\n## Features\n\n- **Multiple formats**: CSV, JSON, tree view\n- **Interactive UI**: Built-in picker for TTY mode\n- **Filtering options**: Login only, reboot only, all records\n- **Session duration**: Calculated login session lengths\n- **Tree view**: Grouped by system reboot\n\n---\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `x last` | I",
  "cost": {
    "context_tokens": 528
  }
}

Fetch it by URL: GET /api/v1/registry/x-cmd-x-cmd-last/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.