Skip to content
deshmukhmayurPublic

About

Offline-first CLI that estimates the true cost of creative projects.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OmniCost

Know what your print actually costs before you hit slice.

OmniCost is an offline-first CLI that estimates the true cost of creative projects — filament, electricity, equipment wear-and-tear, labor, profit margin, and GST — for Indian makers and illustrators. v1 ships with full 3D-printing support; the architecture is built to accept art and illustration modules later.

Why

Existing calculators stop at filament weight. OmniCost models the costs that actually decide whether a commission is profitable:

  • Material — grams used × cost per kg
  • Electricity — flat rate or MSEDCL-style telescopic slab tiers (Maharashtra)
  • Wear-and-tear — per-hour equipment cost
  • Labor — billable hours × hourly rate
  • Margin & GST — margin applied to base cost, then GST on the margined amount

Features

  • 🔌 Plug-in cost modules — shared financial engine, domain-specific inputs per medium (3D printing today; art/illustration tomorrow)
  • 🇮🇳 Indian regional defaults — INR with proper digit grouping (₹1,00,000.00), GST, MSEDCL slab tiers, all user-configurable
  • 📋 Profiles — save printers (power draw, wear rate) and materials (cost per kg) in config, reference by name
  • 🧮 Telescopic slab calculation — job kWh split across tiers correctly, with an explicit caveat
  • 🔒 Strictly offline — no network calls, ever
  • ✅ Full precision math — f64 throughout; rounding to paise only at display

Installation

Requires the Rust toolchain (1.70+).

git clone https://github.com/deshmukhmayur/omnicost.git
cd omnicost
cargo install --path .

Quick start

# First run creates a default config at ~/.config/omnicost/config.json
omnicost calculate 3d-print \
  --weight-grams 85 \
  --time-hours 4.5 \
  --spool-cost 1200 \
  --power-watts 150 \
  --wear-cost-per-hour 5 \
  --labor-hours 0.5 \
  --labor-rate 200 \
  --margin-percent 20
 OmniCost — 3D Print Estimate

Component     Detail                                Cost
────────────────────────────────────────────────────────
Material      85 g @ ₹1,200.00/kg                ₹102.00
Energy        0.675 kWh @ ₹8.50/kWh                ₹5.74
Wear          4.5 h @ ₹5.00/h                     ₹22.50
Labor         0.5 h @ ₹200.00/h                  ₹100.00
────────────────────────────────────────────────────────
Base cost                                        ₹230.24
Margin +20%                                       ₹46.05
GST 18%                                           ₹49.73
────────────────────────────────────────────────────────
FINAL PRICE                                      ₹326.02

Usage

omnicost calculate 3d-print

Flag Description
--weight-grams <g> Filament used (required, must be > 0)
--time-hours <h> Print duration (required, must be > 0)
--spool-cost <₹/kg> Filament cost per kg (overrides --material)
--power-watts <w> Printer power draw (overrides --printer)
--wear-cost-per-hour <₹> Equipment wear rate (defaults to 0)
--labor-hours <h> Billable labor hours
--labor-rate <₹/h> Hourly labor rate (defaults to config)
--margin-percent <%> Profit margin (defaults to config)
--printer <name> Look up power draw and wear rate from a profile
--material <name> Look up filament cost from a profile
--no-gst Skip GST for this estimate
--config <path> Use an alternate config file (overrides OMNICOST_CONFIG)

omnicost config show

Print the resolved configuration.

omnicost config set-electricity

omnicost config set-electricity --rate 10.25 --mode slabs
  • --rate <₹/kWh> — flat electricity rate
  • --mode <flat|slabs> — billing mode (slabs uses the msedcl_slabs tiers in config)

Configuration

Config lives at ~/.config/omnicost/config.json (override with OMNICOST_CONFIG or --config). Defaults are written on first run:

{
  "currency": "INR",
  "symbol": "₹",
  "tax": { "enable_gst": true, "gst_rate_percent": 18.0 },
  "electricity": {
    "mode": "flat",
    "flat_rate_per_kwh": 8.50,
    "msedcl_slabs": [
      { "min_units": 0,   "max_units": 100,  "rate": 5.50 },
      { "min_units": 101, "max_units": 300,  "rate": 8.90 },
      { "min_units": 301, "max_units": null, "rate": 12.50 }
    ]
  },
  "labor":   { "default_rate": 200.0 },
  "margin":  { "default_percent": 0.0 },
  "profiles": {
    "printers":  [ { "name": "Ender-3 V2", "power_watts": 120.0, "wear_cost_per_hour": 5.0 } ],
    "materials": [ { "name": "Generic PLA", "cost_per_kg": 1000.0 } ]
  }
}

Notes:

  • Slab tiers must be contiguous (min_units = previous max_units + 1), rates must be positive, and the top tier must be open-ended ("max_units": null). Invalid configs fail with a readable error naming the offending field.
  • Only INR is supported in v1; other currencies error cleanly.

Error handling

OmniCost never panics. Errors exit with code 2 (bad input/config) or 1 (runtime/I-O) and a human-readable message on stderr.

Development

cargo test        # unit + config + integration suites
cargo clippy      # lint

Roadmap

  • Interactive mode (v1.1)
  • Art & illustration cost modules
  • Non-INR currency support

License

Apache-2.0 — see LICENSE.

About

Offline-first CLI that estimates the true cost of creative projects.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages