Skip to content

CLI and Rust library for managing Fatebook predictions.

License

Notifications You must be signed in to change notification settings

felixmde/fatebook-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fatebook-rs

CLI and library for managing predictions on fatebook.io.

Installation

cargo install fatebook-rs

Setup

Get your API key from fatebook.io/api-setup, then:

fatebook config --set-key

Usage

List your open questions

fatebook list
fatebook list --full-ids

The list output includes a shortened question ID (QID) that is unique for the current list. Use that suffix (or the full ID) for follow-up actions. Use --full-ids to show full question IDs.

List output is sorted by resolve date (earliest first). Use --sort to change or --no-sort to preserve API order.

Create a new question

# Resolve in 2 weeks, 70% confidence
fatebook new "Will I finish the project?" 0.7 --in 2w

# Resolve by specific date
fatebook new "Will it rain tomorrow?" 0.3 --by 2026-01-30

Show question details

fatebook show f8qsg5gk  # Use QID suffix from list output
fatebook show cmkodsxi70001pe92upx89p9k  # Or use full QID

Resolve a question

fatebook resolve f8qsg5gk yes    # or: no, ambiguous
fatebook resolve cmkodsxi70001pe92upx89p9k yes

resolve looks up suffixes against unresolved questions only. Use the full ID if a suffix is ambiguous. Suffix lookups are not scoped to list filters like --resolving-soon or --tag-ids. If a suffix matches multiple questions, the CLI will list the matching full IDs; rerun the command with a longer suffix or the full ID.

Edit a question

fatebook edit f8qsg5gk --title "Updated question?" --note "Added context"
fatebook edit cmkodsxi70001pe92upx89p9k --note "Added context"

Delete a question

fatebook delete f8qsg5gk
fatebook delete cmkodsxi70001pe92upx89p9k

Library Usage

The crate also provides an async library for use in Rust applications:

[dependencies]
fatebook-rs = { version = "0.1", default-features = false }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
use fatebook::{FatebookClient, CreateQuestionParams};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = FatebookClient::new("your-api-key".into(), None);

    // List questions
    let questions = client.get_questions(None).await?;
    for q in questions {
        println!("{}: {}", q.id, q.title);
    }

    // Create a question
    let params = CreateQuestionParams::new(
        "Will this work?".into(),
        "2026-12-31".into(),
        0.8,
    );
    let created = client.create_question(params).await?;
    println!("Created: {}", created.url);

    Ok(())
}

License

MIT

About

CLI and Rust library for managing Fatebook predictions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages