Convert selected edges to bones?
I expect the skin modifier can a create the armature that you are after.

If you only want a rig for a portion of your mesh, duplicate the mesh an delete the excess parts.

Add a skin modifier. You may want to use Mark Root in edit mode with one vertex selected at the end of your mesh, this can prevent extra bones and keep the bones facing in the same direction.

Click the Create Armature button in the skin modifier.



You can then delete the skin modifier, or the duplicate mesh if you duplicated it to start with and you are left with an armature matching the edges of your mesh. The new armature has the display set to stick which you can change to octahedral in the armature settings.