Command line utility needs read access to file in current dir


I have a command line utility that I wrote which reads in a markdown file, converts it to an HTML file and then launches it in the user’s default web browser. I’d like to create a snap for it.

It needs to be able to do the following things:

  1. Read a file in the current directory, like
  2. Write a file to the default temp directory
  3. Launch a web browser via xdg-open, which will load and display the temp file

In order to do all of this, do I need to set confinement to classic? This is my first time attempting to build a snap package, so I’m not super familiar with all the terminology and how it all works.


The home interface might be enough, especially if the tool can read from stdin to work around situations where home isn’t enough.


That’s a good point. So far I use it to view markdown files in source repositories that are in a path under my home directory.


home and removable-media plugs interfaces are essential to snaps that require regular access to regular files in regular locations.


Thanks for that info. Like I said, I’m new to snaps so I appreciate the pointers. I didn’t realize that plugs was what I was looking for. I think i can do what i need with plugs.


Here’s your pointer: Interfaces - doc -, just in case you haven’t found it.